From 6d19fdd55e4a5a3c792d44a9fa85d37241676559 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 3 Aug 2023 17:09:16 +0500 Subject: [PATCH] from server --- .../controllers/api/ProductsApiController.php | 2 +- plugins/ahmadfatoni/apigenerator/routes.php | 4 ++- ...der_table_create_tps_birzha_messages_2.php | 27 +++++++++++++++++++ plugins/tps/birzha/updates/version.yaml | 3 +++ 4 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 plugins/tps/birzha/updates/builder_table_create_tps_birzha_messages_2.php diff --git a/plugins/ahmadfatoni/apigenerator/controllers/api/ProductsApiController.php b/plugins/ahmadfatoni/apigenerator/controllers/api/ProductsApiController.php index b1fa432..9f9913b 100644 --- a/plugins/ahmadfatoni/apigenerator/controllers/api/ProductsApiController.php +++ b/plugins/ahmadfatoni/apigenerator/controllers/api/ProductsApiController.php @@ -512,7 +512,7 @@ class ProductsAPIController extends Controller public function myProducts() { - dd("sdf"); + //dd("sdf"); $perPage = intval(input('custom_per_page')); // intval protects from injection try { diff --git a/plugins/ahmadfatoni/apigenerator/routes.php b/plugins/ahmadfatoni/apigenerator/routes.php index 9a933bd..3ae1787 100644 --- a/plugins/ahmadfatoni/apigenerator/routes.php +++ b/plugins/ahmadfatoni/apigenerator/routes.php @@ -55,10 +55,12 @@ Route::group(['prefix' =>'api/v1','namespace' =>'AhmadFatoni\ApiGenerator\Contro ->where('id', '[0-9]+'); - Route::get('my-products','ProductsApiController@customerProducts'); + Route::get('my-products','ProductsApiController@myProducts'); Route::get('my-products/{id}','ProductsApiController@showMyProductById'); Route::delete('my-products/{id}', 'ProductsApiController@delete') ->where('id', '[0-9]+'); + + Route::resource('messages', 'MessagesapiController', ['except' => ['destroy', 'create', 'edit']]); Route::get('messages/chatroom/{id}', 'MessagesapiController@enterChatroom') ->where('id', '[0-9]+'); diff --git a/plugins/tps/birzha/updates/builder_table_create_tps_birzha_messages_2.php b/plugins/tps/birzha/updates/builder_table_create_tps_birzha_messages_2.php new file mode 100644 index 0000000..ae9fbbd --- /dev/null +++ b/plugins/tps/birzha/updates/builder_table_create_tps_birzha_messages_2.php @@ -0,0 +1,27 @@ +engine = 'InnoDB'; + $table->bigIncrements('id')->unsigned(); + $table->integer('sender_id'); + $table->integer('reciver_id'); + $table->dateTime('send_at'); + $table->dateTime('read_at')->nullable(); + $table->text('message'); + $table->timestamp('deleted_at')->nullable(); + }); + } + + public function down() + { + Schema::dropIfExists('tps_birzha_messages'); + } +} diff --git a/plugins/tps/birzha/updates/version.yaml b/plugins/tps/birzha/updates/version.yaml index 9d74043..e703cd7 100644 --- a/plugins/tps/birzha/updates/version.yaml +++ b/plugins/tps/birzha/updates/version.yaml @@ -386,3 +386,6 @@ 1.0.135: - 'Updated table tps_birzha_comments' - builder_table_update_tps_birzha_comments_3.php +1.0.136: + - 'Created table tps_birzha_messages' + - builder_table_create_tps_birzha_messages_2.php