From ecccedbabb66fee70af58c4098ad003ee98fa75b Mon Sep 17 00:00:00 2001 From: mrNikto9 Date: Wed, 17 Jul 2024 20:01:18 +0500 Subject: [PATCH] added api --- .../controllers/api/contactController.php | 99 +++++++++++++++++++ .../api/mainServicesController.php | 99 +++++++++++++++++++ plugins/ahmadfatoni/apigenerator/routes.php | 8 +- .../tps/controllers/ContactsController.php | 23 +++++ .../controllers/MainServicesController.php | 23 +++++ .../contactscontroller/_list_toolbar.php | 16 +++ .../contactscontroller/config_form.yaml | 10 ++ .../contactscontroller/config_list.yaml | 12 +++ .../controllers/contactscontroller/create.php | 46 +++++++++ .../controllers/contactscontroller/index.php | 1 + .../contactscontroller/preview.php | 22 +++++ .../controllers/contactscontroller/update.php | 54 ++++++++++ .../mainservicescontroller/_list_toolbar.php | 16 +++ .../mainservicescontroller/config_form.yaml | 10 ++ .../mainservicescontroller/config_list.yaml | 12 +++ .../mainservicescontroller/create.php | 46 +++++++++ .../mainservicescontroller/index.php | 1 + .../mainservicescontroller/preview.php | 22 +++++ .../mainservicescontroller/update.php | 54 ++++++++++ plugins/tps/tps/models/Contacts.php | 28 ++++++ plugins/tps/tps/models/MainServices.php | 28 ++++++ plugins/tps/tps/models/contacts/columns.yaml | 16 +++ plugins/tps/tps/models/contacts/fields.yaml | 26 +++++ .../tps/tps/models/mainservices/columns.yaml | 13 +++ .../tps/tps/models/mainservices/fields.yaml | 21 ++++ plugins/tps/tps/plugin.yaml | 12 ++- .../builder_table_create_tps_tps_contacts.php | 26 +++++ ...uilder_table_create_tps_tps_contacts_2.php | 26 +++++ ...uilder_table_create_tps_tps_services_2.php | 25 +++++ plugins/tps/tps/updates/version.yaml | 6 ++ 30 files changed, 797 insertions(+), 4 deletions(-) create mode 100644 plugins/ahmadfatoni/apigenerator/controllers/api/contactController.php create mode 100644 plugins/ahmadfatoni/apigenerator/controllers/api/mainServicesController.php create mode 100644 plugins/tps/tps/controllers/ContactsController.php create mode 100644 plugins/tps/tps/controllers/MainServicesController.php create mode 100644 plugins/tps/tps/controllers/contactscontroller/_list_toolbar.php create mode 100644 plugins/tps/tps/controllers/contactscontroller/config_form.yaml create mode 100644 plugins/tps/tps/controllers/contactscontroller/config_list.yaml create mode 100644 plugins/tps/tps/controllers/contactscontroller/create.php create mode 100644 plugins/tps/tps/controllers/contactscontroller/index.php create mode 100644 plugins/tps/tps/controllers/contactscontroller/preview.php create mode 100644 plugins/tps/tps/controllers/contactscontroller/update.php create mode 100644 plugins/tps/tps/controllers/mainservicescontroller/_list_toolbar.php create mode 100644 plugins/tps/tps/controllers/mainservicescontroller/config_form.yaml create mode 100644 plugins/tps/tps/controllers/mainservicescontroller/config_list.yaml create mode 100644 plugins/tps/tps/controllers/mainservicescontroller/create.php create mode 100644 plugins/tps/tps/controllers/mainservicescontroller/index.php create mode 100644 plugins/tps/tps/controllers/mainservicescontroller/preview.php create mode 100644 plugins/tps/tps/controllers/mainservicescontroller/update.php create mode 100644 plugins/tps/tps/models/Contacts.php create mode 100644 plugins/tps/tps/models/MainServices.php create mode 100644 plugins/tps/tps/models/contacts/columns.yaml create mode 100644 plugins/tps/tps/models/contacts/fields.yaml create mode 100644 plugins/tps/tps/models/mainservices/columns.yaml create mode 100644 plugins/tps/tps/models/mainservices/fields.yaml create mode 100644 plugins/tps/tps/updates/builder_table_create_tps_tps_contacts.php create mode 100644 plugins/tps/tps/updates/builder_table_create_tps_tps_contacts_2.php create mode 100644 plugins/tps/tps/updates/builder_table_create_tps_tps_services_2.php diff --git a/plugins/ahmadfatoni/apigenerator/controllers/api/contactController.php b/plugins/ahmadfatoni/apigenerator/controllers/api/contactController.php new file mode 100644 index 0000000..a9f3ef2 --- /dev/null +++ b/plugins/ahmadfatoni/apigenerator/controllers/api/contactController.php @@ -0,0 +1,99 @@ +Contacts = $Contacts; + $this->helpers = $helpers; + } + + public function index(){ + + $data = $this->Contacts->all()->toArray(); + + return $this->helpers->apiArrayResponseBuilder(200, 'success', $data); + } + + public function show($id){ + + $data = $this->Contacts::find($id); + + if ($data){ + return $this->helpers->apiArrayResponseBuilder(200, 'success', [$data]); + } else { + $this->helpers->apiArrayResponseBuilder(404, 'not found', ['error' => 'Resource id=' . $id . ' could not be found']); + } + + } + + public function store(Request $request){ + + $arr = $request->all(); + + while ( $data = current($arr)) { + $this->Contacts->{key($arr)} = $data; + next($arr); + } + + $validation = Validator::make($request->all(), $this->Contacts->rules); + + if( $validation->passes() ){ + $this->Contacts->save(); + return $this->helpers->apiArrayResponseBuilder(201, 'created', ['id' => $this->Contacts->id]); + }else{ + return $this->helpers->apiArrayResponseBuilder(400, 'fail', $validation->errors() ); + } + + } + + public function update($id, Request $request){ + + $status = $this->Contacts->where('id',$id)->update($data); + + if( $status ){ + + return $this->helpers->apiArrayResponseBuilder(200, 'success', 'Data has been updated successfully.'); + + }else{ + + return $this->helpers->apiArrayResponseBuilder(400, 'bad request', 'Error, data failed to update.'); + + } + } + + public function delete($id){ + + $this->Contacts->where('id',$id)->delete(); + + return $this->helpers->apiArrayResponseBuilder(200, 'success', 'Data has been deleted successfully.'); + } + + public function destroy($id){ + + $this->Contacts->where('id',$id)->delete(); + + return $this->helpers->apiArrayResponseBuilder(200, 'success', 'Data has been deleted successfully.'); + } + + + public static function getAfterFilters() {return [];} + public static function getBeforeFilters() {return [];} + public static function getMiddleware() {return [];} + public function callAction($method, $parameters=false) { + return call_user_func_array(array($this, $method), $parameters); + } + +} \ No newline at end of file diff --git a/plugins/ahmadfatoni/apigenerator/controllers/api/mainServicesController.php b/plugins/ahmadfatoni/apigenerator/controllers/api/mainServicesController.php new file mode 100644 index 0000000..8f12bc0 --- /dev/null +++ b/plugins/ahmadfatoni/apigenerator/controllers/api/mainServicesController.php @@ -0,0 +1,99 @@ +MainServices = $MainServices; + $this->helpers = $helpers; + } + + public function index(){ + + $data = $this->MainServices->all()->toArray(); + + return $this->helpers->apiArrayResponseBuilder(200, 'success', $data); + } + + public function show($id){ + + $data = $this->MainServices::find($id); + + if ($data){ + return $this->helpers->apiArrayResponseBuilder(200, 'success', [$data]); + } else { + $this->helpers->apiArrayResponseBuilder(404, 'not found', ['error' => 'Resource id=' . $id . ' could not be found']); + } + + } + + public function store(Request $request){ + + $arr = $request->all(); + + while ( $data = current($arr)) { + $this->MainServices->{key($arr)} = $data; + next($arr); + } + + $validation = Validator::make($request->all(), $this->MainServices->rules); + + if( $validation->passes() ){ + $this->MainServices->save(); + return $this->helpers->apiArrayResponseBuilder(201, 'created', ['id' => $this->MainServices->id]); + }else{ + return $this->helpers->apiArrayResponseBuilder(400, 'fail', $validation->errors() ); + } + + } + + public function update($id, Request $request){ + + $status = $this->MainServices->where('id',$id)->update($data); + + if( $status ){ + + return $this->helpers->apiArrayResponseBuilder(200, 'success', 'Data has been updated successfully.'); + + }else{ + + return $this->helpers->apiArrayResponseBuilder(400, 'bad request', 'Error, data failed to update.'); + + } + } + + public function delete($id){ + + $this->MainServices->where('id',$id)->delete(); + + return $this->helpers->apiArrayResponseBuilder(200, 'success', 'Data has been deleted successfully.'); + } + + public function destroy($id){ + + $this->MainServices->where('id',$id)->delete(); + + return $this->helpers->apiArrayResponseBuilder(200, 'success', 'Data has been deleted successfully.'); + } + + + public static function getAfterFilters() {return [];} + public static function getBeforeFilters() {return [];} + public static function getMiddleware() {return [];} + public function callAction($method, $parameters=false) { + return call_user_func_array(array($this, $method), $parameters); + } + +} \ No newline at end of file diff --git a/plugins/ahmadfatoni/apigenerator/routes.php b/plugins/ahmadfatoni/apigenerator/routes.php index bc49b1e..8bcaea4 100644 --- a/plugins/ahmadfatoni/apigenerator/routes.php +++ b/plugins/ahmadfatoni/apigenerator/routes.php @@ -6,11 +6,15 @@ Route::get('fatoni/delete/api/{id}', array('as' => 'fatoni.delete.api', 'uses' = Route::resource('api/v1/pages', 'AhmadFatoni\ApiGenerator\Controllers\API\PagesController', ['except' => ['destroy', 'create', 'edit']]); Route::get('api/v1/pages/{id}/delete', ['as' => 'api/v1/pages.delete', 'uses' => 'AhmadFatoni\ApiGenerator\Controllers\API\PagesController@destroy']); +Route::resource('api/v1/home-services', 'AhmadFatoni\ApiGenerator\Controllers\API\ServicesController', ['except' => ['destroy', 'create', 'edit']]); +Route::get('api/v1/home-services/{id}/delete', ['as' => 'api/v1/home-services.delete', 'uses' => 'AhmadFatoni\ApiGenerator\Controllers\API\ServicesController@destroy']); Route::resource('api/v1/home-projects', 'AhmadFatoni\ApiGenerator\Controllers\API\ProjectsController', ['except' => ['destroy', 'create', 'edit']]); Route::get('api/v1/home-projects/{id}/delete', ['as' => 'api/v1/home-projects.delete', 'uses' => 'AhmadFatoni\ApiGenerator\Controllers\API\ProjectsController@destroy']); Route::resource('api/v1/partners', 'AhmadFatoni\ApiGenerator\Controllers\API\PartnersController', ['except' => ['destroy', 'create', 'edit']]); Route::get('api/v1/partners/{id}/delete', ['as' => 'api/v1/partners.delete', 'uses' => 'AhmadFatoni\ApiGenerator\Controllers\API\PartnersController@destroy']); Route::resource('api/v1/cartoons', 'AhmadFatoni\ApiGenerator\Controllers\API\CartoonsController', ['except' => ['destroy', 'create', 'edit']]); Route::get('api/v1/cartoons/{id}/delete', ['as' => 'api/v1/cartoons.delete', 'uses' => 'AhmadFatoni\ApiGenerator\Controllers\API\CartoonsController@destroy']); -Route::resource('api/v1/home-services', 'AhmadFatoni\ApiGenerator\Controllers\API\ServicesController', ['except' => ['destroy', 'create', 'edit']]); -Route::get('api/v1/home-services/{id}/delete', ['as' => 'api/v1/home-services.delete', 'uses' => 'AhmadFatoni\ApiGenerator\Controllers\API\ServicesController@destroy']); \ No newline at end of file +Route::resource('api/v1/mainServices', 'AhmadFatoni\ApiGenerator\Controllers\API\mainServicesController', ['except' => ['destroy', 'create', 'edit']]); +Route::get('api/v1/mainServices/{id}/delete', ['as' => 'api/v1/mainServices.delete', 'uses' => 'AhmadFatoni\ApiGenerator\Controllers\API\mainServicesController@destroy']); +Route::resource('api/v1/contact', 'AhmadFatoni\ApiGenerator\Controllers\API\contactController', ['except' => ['destroy', 'create', 'edit']]); +Route::get('api/v1/contact/{id}/delete', ['as' => 'api/v1/contact.delete', 'uses' => 'AhmadFatoni\ApiGenerator\Controllers\API\contactController@destroy']); \ No newline at end of file diff --git a/plugins/tps/tps/controllers/ContactsController.php b/plugins/tps/tps/controllers/ContactsController.php new file mode 100644 index 0000000..4494e74 --- /dev/null +++ b/plugins/tps/tps/controllers/ContactsController.php @@ -0,0 +1,23 @@ + + + + + + diff --git a/plugins/tps/tps/controllers/contactscontroller/config_form.yaml b/plugins/tps/tps/controllers/contactscontroller/config_form.yaml new file mode 100644 index 0000000..1035fd6 --- /dev/null +++ b/plugins/tps/tps/controllers/contactscontroller/config_form.yaml @@ -0,0 +1,10 @@ +name: ContactsController +form: $/tps/tps/models/contacts/fields.yaml +modelClass: Tps\Tps\Models\Contacts +defaultRedirect: tps/tps/contactscontroller +create: + redirect: 'tps/tps/contactscontroller/update/:id' + redirectClose: tps/tps/contactscontroller +update: + redirect: tps/tps/contactscontroller + redirectClose: tps/tps/contactscontroller diff --git a/plugins/tps/tps/controllers/contactscontroller/config_list.yaml b/plugins/tps/tps/controllers/contactscontroller/config_list.yaml new file mode 100644 index 0000000..f995d33 --- /dev/null +++ b/plugins/tps/tps/controllers/contactscontroller/config_list.yaml @@ -0,0 +1,12 @@ +list: $/tps/tps/models/contacts/columns.yaml +modelClass: Tps\Tps\Models\Contacts +title: ContactsController +noRecordsMessage: 'backend::lang.list.no_records' +showSetup: true +showCheckboxes: true +recordsPerPage: 20 +toolbar: + buttons: list_toolbar + search: + prompt: 'backend::lang.list.search_prompt' +recordUrl: 'tps/tps/contactscontroller/update/:id' diff --git a/plugins/tps/tps/controllers/contactscontroller/create.php b/plugins/tps/tps/controllers/contactscontroller/create.php new file mode 100644 index 0000000..c99607a --- /dev/null +++ b/plugins/tps/tps/controllers/contactscontroller/create.php @@ -0,0 +1,46 @@ + + + + +fatalError): ?> + + 'layout']) ?> + +
+ formRender() ?> +
+ +
+
+ + + + + +
+
+ + + + +

fatalError)) ?>

+

+ \ No newline at end of file diff --git a/plugins/tps/tps/controllers/contactscontroller/index.php b/plugins/tps/tps/controllers/contactscontroller/index.php new file mode 100644 index 0000000..ea43a36 --- /dev/null +++ b/plugins/tps/tps/controllers/contactscontroller/index.php @@ -0,0 +1 @@ +listRender() ?> diff --git a/plugins/tps/tps/controllers/contactscontroller/preview.php b/plugins/tps/tps/controllers/contactscontroller/preview.php new file mode 100644 index 0000000..c28e9fb --- /dev/null +++ b/plugins/tps/tps/controllers/contactscontroller/preview.php @@ -0,0 +1,22 @@ + + + + +fatalError): ?> + +
+ formRenderPreview() ?> +
+ + +

fatalError) ?>

+ + +

+ + + +

\ No newline at end of file diff --git a/plugins/tps/tps/controllers/contactscontroller/update.php b/plugins/tps/tps/controllers/contactscontroller/update.php new file mode 100644 index 0000000..d45c798 --- /dev/null +++ b/plugins/tps/tps/controllers/contactscontroller/update.php @@ -0,0 +1,54 @@ + + + + +fatalError): ?> + + 'layout']) ?> + +
+ formRender() ?> +
+ +
+
+ + + + + + + +
+
+ + + +

fatalError)) ?>

+

+ \ No newline at end of file diff --git a/plugins/tps/tps/controllers/mainservicescontroller/_list_toolbar.php b/plugins/tps/tps/controllers/mainservicescontroller/_list_toolbar.php new file mode 100644 index 0000000..724917c --- /dev/null +++ b/plugins/tps/tps/controllers/mainservicescontroller/_list_toolbar.php @@ -0,0 +1,16 @@ +
+ + + + +
diff --git a/plugins/tps/tps/controllers/mainservicescontroller/config_form.yaml b/plugins/tps/tps/controllers/mainservicescontroller/config_form.yaml new file mode 100644 index 0000000..7ee5541 --- /dev/null +++ b/plugins/tps/tps/controllers/mainservicescontroller/config_form.yaml @@ -0,0 +1,10 @@ +name: MainServicesController +form: $/tps/tps/models/mainservices/fields.yaml +modelClass: Tps\Tps\Models\MainServices +defaultRedirect: tps/tps/mainservicescontroller +create: + redirect: 'tps/tps/mainservicescontroller/update/:id' + redirectClose: tps/tps/mainservicescontroller +update: + redirect: tps/tps/mainservicescontroller + redirectClose: tps/tps/mainservicescontroller diff --git a/plugins/tps/tps/controllers/mainservicescontroller/config_list.yaml b/plugins/tps/tps/controllers/mainservicescontroller/config_list.yaml new file mode 100644 index 0000000..c9e8176 --- /dev/null +++ b/plugins/tps/tps/controllers/mainservicescontroller/config_list.yaml @@ -0,0 +1,12 @@ +list: $/tps/tps/models/mainservices/columns.yaml +modelClass: Tps\Tps\Models\MainServices +title: MainServicesController +noRecordsMessage: 'backend::lang.list.no_records' +showSetup: true +showCheckboxes: true +recordsPerPage: 20 +toolbar: + buttons: list_toolbar + search: + prompt: 'backend::lang.list.search_prompt' +recordUrl: 'tps/tps/mainservicescontroller/update/:id' diff --git a/plugins/tps/tps/controllers/mainservicescontroller/create.php b/plugins/tps/tps/controllers/mainservicescontroller/create.php new file mode 100644 index 0000000..30276aa --- /dev/null +++ b/plugins/tps/tps/controllers/mainservicescontroller/create.php @@ -0,0 +1,46 @@ + + + + +fatalError): ?> + + 'layout']) ?> + +
+ formRender() ?> +
+ +
+
+ + + + + +
+
+ + + + +

fatalError)) ?>

+

+ \ No newline at end of file diff --git a/plugins/tps/tps/controllers/mainservicescontroller/index.php b/plugins/tps/tps/controllers/mainservicescontroller/index.php new file mode 100644 index 0000000..ea43a36 --- /dev/null +++ b/plugins/tps/tps/controllers/mainservicescontroller/index.php @@ -0,0 +1 @@ +listRender() ?> diff --git a/plugins/tps/tps/controllers/mainservicescontroller/preview.php b/plugins/tps/tps/controllers/mainservicescontroller/preview.php new file mode 100644 index 0000000..8435713 --- /dev/null +++ b/plugins/tps/tps/controllers/mainservicescontroller/preview.php @@ -0,0 +1,22 @@ + + + + +fatalError): ?> + +
+ formRenderPreview() ?> +
+ + +

fatalError) ?>

+ + +

+ + + +

\ No newline at end of file diff --git a/plugins/tps/tps/controllers/mainservicescontroller/update.php b/plugins/tps/tps/controllers/mainservicescontroller/update.php new file mode 100644 index 0000000..e2001fd --- /dev/null +++ b/plugins/tps/tps/controllers/mainservicescontroller/update.php @@ -0,0 +1,54 @@ + + + + +fatalError): ?> + + 'layout']) ?> + +
+ formRender() ?> +
+ +
+
+ + + + + + + +
+
+ + + +

fatalError)) ?>

+

+ \ No newline at end of file diff --git a/plugins/tps/tps/models/Contacts.php b/plugins/tps/tps/models/Contacts.php new file mode 100644 index 0000000..c73e417 --- /dev/null +++ b/plugins/tps/tps/models/Contacts.php @@ -0,0 +1,28 @@ + 'System\Models\File' + ]; + +} diff --git a/plugins/tps/tps/models/MainServices.php b/plugins/tps/tps/models/MainServices.php new file mode 100644 index 0000000..be4b511 --- /dev/null +++ b/plugins/tps/tps/models/MainServices.php @@ -0,0 +1,28 @@ + 'array', + ]; + +} diff --git a/plugins/tps/tps/models/contacts/columns.yaml b/plugins/tps/tps/models/contacts/columns.yaml new file mode 100644 index 0000000..b5f11db --- /dev/null +++ b/plugins/tps/tps/models/contacts/columns.yaml @@ -0,0 +1,16 @@ +columns: + id: + label: id + type: number + name: + label: name + type: text + email: + label: email + type: text + created_at: + label: created_at + type: datetime + updated_at: + label: updated_at + type: datetime diff --git a/plugins/tps/tps/models/contacts/fields.yaml b/plugins/tps/tps/models/contacts/fields.yaml new file mode 100644 index 0000000..e7a0e79 --- /dev/null +++ b/plugins/tps/tps/models/contacts/fields.yaml @@ -0,0 +1,26 @@ +fields: + name: + label: Name + span: auto + type: text + email: + label: Email + span: auto + type: text + phone: + label: Phone + span: auto + type: text + message: + label: Message + span: auto + type: text + file: + label: File + mode: file + useCaption: true + thumbOptions: + mode: crop + extension: auto + span: auto + type: fileupload diff --git a/plugins/tps/tps/models/mainservices/columns.yaml b/plugins/tps/tps/models/mainservices/columns.yaml new file mode 100644 index 0000000..2c637af --- /dev/null +++ b/plugins/tps/tps/models/mainservices/columns.yaml @@ -0,0 +1,13 @@ +columns: + id: + label: id + type: number + title: + label: title + type: text + created_at: + label: created_at + type: datetime + updated_at: + label: updated_at + type: datetime diff --git a/plugins/tps/tps/models/mainservices/fields.yaml b/plugins/tps/tps/models/mainservices/fields.yaml new file mode 100644 index 0000000..6a81cd2 --- /dev/null +++ b/plugins/tps/tps/models/mainservices/fields.yaml @@ -0,0 +1,21 @@ +fields: + title: + label: Title + span: auto + type: text + text: + label: Text + span: auto + type: text + parts: + label: Services + prompt: 'Add new item' + displayMode: accordion + span: auto + type: repeater + form: + fields: + item: + label: Parts + span: auto + type: text diff --git a/plugins/tps/tps/plugin.yaml b/plugins/tps/tps/plugin.yaml index 2abff1a..ecb66d5 100644 --- a/plugins/tps/tps/plugin.yaml +++ b/plugins/tps/tps/plugin.yaml @@ -15,11 +15,11 @@ navigation: url: tps/tps/pagescontroller icon: icon-align-center side-menu-item2: - label: Services + label: 'Home Services' url: tps/tps/servicescontroller icon: icon-sitemap side-menu-item3: - label: Projects + label: 'Home Projects' url: tps/tps/projectscontoller icon: icon-folder-open-o side-menu-item4: @@ -30,3 +30,11 @@ navigation: label: Cartoons url: tps/tps/cartoonscontroller icon: icon-image + side-menu-item6: + label: 'Main Services' + url: tps/tps/mainservicescontroller + icon: icon-signal + main-menu-item2: + label: Contacts + url: tps/tps/contactscontroller + icon: icon-comment diff --git a/plugins/tps/tps/updates/builder_table_create_tps_tps_contacts.php b/plugins/tps/tps/updates/builder_table_create_tps_tps_contacts.php new file mode 100644 index 0000000..00fac89 --- /dev/null +++ b/plugins/tps/tps/updates/builder_table_create_tps_tps_contacts.php @@ -0,0 +1,26 @@ +increments('id')->unsigned(); + $table->string('name'); + $table->string('email'); + $table->string('phone'); + $table->text('message'); + $table->timestamp('created_at')->nullable(); + $table->timestamp('updated_at')->nullable(); + }); + } + + public function down() + { + Schema::dropIfExists('tps_tps_contacts'); + } +} diff --git a/plugins/tps/tps/updates/builder_table_create_tps_tps_contacts_2.php b/plugins/tps/tps/updates/builder_table_create_tps_tps_contacts_2.php new file mode 100644 index 0000000..0c8fcf8 --- /dev/null +++ b/plugins/tps/tps/updates/builder_table_create_tps_tps_contacts_2.php @@ -0,0 +1,26 @@ +increments('id')->unsigned(); + $table->string('name'); + $table->string('email'); + $table->string('phone'); + $table->text('message'); + $table->timestamp('created_at')->nullable(); + $table->timestamp('updated_at')->nullable(); + }); + } + + public function down() + { + Schema::dropIfExists('tps_tps_contacts'); + } +} diff --git a/plugins/tps/tps/updates/builder_table_create_tps_tps_services_2.php b/plugins/tps/tps/updates/builder_table_create_tps_tps_services_2.php new file mode 100644 index 0000000..1b05895 --- /dev/null +++ b/plugins/tps/tps/updates/builder_table_create_tps_tps_services_2.php @@ -0,0 +1,25 @@ +increments('id')->unsigned(); + $table->string('title'); + $table->text('text'); + $table->text('parts'); + $table->timestamp('created_at')->nullable(); + $table->timestamp('updated_at')->nullable(); + }); + } + + public function down() + { + Schema::dropIfExists('tps_tps_services'); + } +} diff --git a/plugins/tps/tps/updates/version.yaml b/plugins/tps/tps/updates/version.yaml index 9d1bb05..1432c54 100644 --- a/plugins/tps/tps/updates/version.yaml +++ b/plugins/tps/tps/updates/version.yaml @@ -33,3 +33,9 @@ v1.0.11: v1.0.12: - 'Updated table tps_tps_services' - builder_table_update_tps_tps_home_services.php +v1.0.13: + - 'Created table tps_tps_contacts' + - builder_table_create_tps_tps_contacts.php +v1.0.14: + - 'Created table tps_tps_contacts' + - builder_table_create_tps_tps_contacts_2.php