From a7afbd69fbd0424d7cf25a5635ddd16855bb073a Mon Sep 17 00:00:00 2001 From: arifal Date: Fri, 21 Feb 2025 09:07:15 +0700 Subject: [PATCH] fix conflict spatial-plannings jamal --- .../Api/SpatialPlanningsController.php | 103 ----- .../SpatialPlanningsController.php | 28 -- composer.json | 1 - ..._113154_create_spatial_plannings_table.php | 34 -- database/seeders/UsersRoleMenuSeeder.php | 2 +- resources/js/spatial-plannings/create.js | 69 ---- resources/js/spatial-plannings/index.js | 156 ------- resources/js/spatial-plannings/update.js | 67 --- resources/js/spatial-plannings/upload.js | 83 ---- .../default/api-controller-base-class.stub | 15 - ...-controller-call-destroy-api-resource.stub | 1 - ...ontroller-call-destroy-success-method.stub | 4 - ...pi-controller-call-index-api-resource.stub | 1 - ...-controller-call-index-success-method.stub | 26 -- ...api-controller-call-show-api-resource.stub | 1 - ...i-controller-call-show-success-method.stub | 4 - ...pi-controller-call-store-api-resource.stub | 1 - ...-controller-call-store-success-method.stub | 4 - ...i-controller-call-update-api-resource.stub | 1 - ...controller-call-update-success-method.stub | 4 - .../api-controller-error-response-method.stub | 14 - .../default/api-controller-get-validator.stub | 16 - ...pi-controller-success-response-method.stub | 18 - .../api-controller-transform-method.stub | 13 - .../default/api-controller-validate.stub | 5 - .../templates/default/api-controller.stub | 104 ----- ...ocumentation-controller-version-based.stub | 21 - .../default/api-documentation-controller.stub | 20 - ...cumentation-field-validation-required.stub | 1 - ...pi-documentation-index-authentication.stub | 11 - ...mentation-index-failed-authentication.stub | 16 - ...ocumentation-index-failed-to-retrieve.stub | 16 - ...documentation-index-failed-validation.stub | 16 - ...-index-fields-list-body-row-for-model.stub | 5 - ...umentation-index-fields-list-body-row.stub | 12 - .../api-documentation-index-fields-list.stub | 37 -- .../api-documentation-index-request.stub | 14 - ...ation-index-retrieved-fields-body-row.stub | 5 - ...-documentation-index-retrieved-fields.stub | 12 - .../api-documentation-index-retrieved.stub | 21 - .../default/api-documentation-index.stub | 386 ------------------ .../default/api-documentation-routes-8.stub | 2 - .../default/api-documentation-routes.stub | 2 - ...ntation-version-based-base-controller.stub | 38 -- .../default/api-resource-collection.stub | 50 --- .../templates/default/api-resource.stub | 59 --- .../templates/default/api-routes-8.stub | 10 - .../templates/default/api-routes.stub | 10 - .../default/controller-affirm-method.stub | 17 - .../default/controller-constructor.stub | 10 - .../controller-getdata-method-5.5.stub | 21 - .../default/controller-getdata-method.stub | 15 - .../default/controller-upload-method-5.3.stub | 19 - .../default/controller-upload-method.stub | 20 - .../templates/default/controller.stub | 126 ------ .../templates/default/create.blade.stub | 46 --- .../templates/default/edit.blade.stub | 47 --- .../default/form-file-field.blade.stub | 14 - .../default/form-helper-field.blade.stub | 1 - .../default/form-input-field.blade.stub | 1 - .../default/form-input-wrapper.blade.stub | 8 - .../default/form-label-field.blade.stub | 1 - .../default/form-month-field.blade.stub | 8 - .../default/form-nolabel-field.blade.stub | 1 - .../default/form-password-field.blade.stub | 1 - .../default/form-pickitems-field.blade.stub | 6 - .../form-pickitems-inline-field.blade.stub | 6 - .../templates/default/form-request.stub | 35 -- .../default/form-selectmenu-field.blade.stub | 9 - .../default/form-selectrange-field.blade.stub | 9 - .../default/form-textarea-field.blade.stub | 1 - .../templates/default/form.blade.stub | 1 - .../templates/default/index.blade.stub | 78 ---- .../default/index.body.cell.blade.stub | 1 - .../default/index.header.cell.blade.stub | 1 - .../templates/default/language.stub | 5 - .../templates/default/layout.stub | 194 --------- .../templates/default/login-partial.stub | 10 - .../default/migration-schema-down.stub | 1 - .../default/migration-schema-up.stub | 4 - .../templates/default/migration.stub | 27 -- .../default/model-accessor-datetime.stub | 1 - .../model-accessor-multiple-answers.stub | 1 - .../templates/default/model-accessor.stub | 10 - .../default/model-mutator-datetime.stub | 1 - .../model-mutator-multiple-answers.stub | 1 - .../templates/default/model-mutator.stub | 10 - .../templates/default/model-primary-key.stub | 6 - .../templates/default/model-relation.stub | 9 - .../templates/default/model-timestamps.stub | 6 - .../templates/default/model.stub | 44 -- .../templates/default/pagination.blade.stub | 50 --- .../templates/default/routes-8.stub | 14 - .../templates/default/routes-group.stub | 6 - .../templates/default/routes.stub | 14 - .../templates/default/show.blade.stub | 42 -- .../templates/default/show.row.blade.stub | 2 - .../templates/default/view-model.stub | 30 -- .../views/spatial-plannings/create.blade.php | 32 -- .../views/spatial-plannings/form.blade.php | 28 -- .../views/spatial-plannings/index.blade.php | 31 -- .../views/spatial-plannings/update.blade.php | 33 -- .../views/spatial-plannings/upload.blade.php | 80 ---- routes/api.php | 8 - routes/web.php | 7 - vite.config.js | 7 +- 106 files changed, 4 insertions(+), 2752 deletions(-) delete mode 100644 app/Http/Controllers/Api/SpatialPlanningsController.php delete mode 100644 app/Http/Controllers/SpatialPlanningsController.php delete mode 100644 database/migrations/2025_02_19_113154_create_spatial_plannings_table.php delete mode 100644 resources/js/spatial-plannings/create.js delete mode 100644 resources/js/spatial-plannings/index.js delete mode 100644 resources/js/spatial-plannings/update.js delete mode 100644 resources/js/spatial-plannings/upload.js delete mode 100644 resources/laravel-code-generator/templates/default/api-controller-base-class.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-controller-call-destroy-api-resource.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-controller-call-destroy-success-method.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-controller-call-index-api-resource.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-controller-call-index-success-method.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-controller-call-show-api-resource.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-controller-call-show-success-method.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-controller-call-store-api-resource.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-controller-call-store-success-method.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-controller-call-update-api-resource.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-controller-call-update-success-method.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-controller-error-response-method.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-controller-get-validator.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-controller-success-response-method.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-controller-transform-method.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-controller-validate.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-controller.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-documentation-controller-version-based.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-documentation-controller.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-documentation-field-validation-required.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-documentation-index-authentication.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-documentation-index-failed-authentication.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-documentation-index-failed-to-retrieve.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-documentation-index-failed-validation.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-documentation-index-fields-list-body-row-for-model.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-documentation-index-fields-list-body-row.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-documentation-index-fields-list.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-documentation-index-request.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-documentation-index-retrieved-fields-body-row.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-documentation-index-retrieved-fields.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-documentation-index-retrieved.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-documentation-index.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-documentation-routes-8.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-documentation-routes.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-documentation-version-based-base-controller.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-resource-collection.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-resource.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-routes-8.stub delete mode 100644 resources/laravel-code-generator/templates/default/api-routes.stub delete mode 100644 resources/laravel-code-generator/templates/default/controller-affirm-method.stub delete mode 100644 resources/laravel-code-generator/templates/default/controller-constructor.stub delete mode 100644 resources/laravel-code-generator/templates/default/controller-getdata-method-5.5.stub delete mode 100644 resources/laravel-code-generator/templates/default/controller-getdata-method.stub delete mode 100644 resources/laravel-code-generator/templates/default/controller-upload-method-5.3.stub delete mode 100644 resources/laravel-code-generator/templates/default/controller-upload-method.stub delete mode 100644 resources/laravel-code-generator/templates/default/controller.stub delete mode 100644 resources/laravel-code-generator/templates/default/create.blade.stub delete mode 100644 resources/laravel-code-generator/templates/default/edit.blade.stub delete mode 100644 resources/laravel-code-generator/templates/default/form-file-field.blade.stub delete mode 100644 resources/laravel-code-generator/templates/default/form-helper-field.blade.stub delete mode 100644 resources/laravel-code-generator/templates/default/form-input-field.blade.stub delete mode 100644 resources/laravel-code-generator/templates/default/form-input-wrapper.blade.stub delete mode 100644 resources/laravel-code-generator/templates/default/form-label-field.blade.stub delete mode 100644 resources/laravel-code-generator/templates/default/form-month-field.blade.stub delete mode 100644 resources/laravel-code-generator/templates/default/form-nolabel-field.blade.stub delete mode 100644 resources/laravel-code-generator/templates/default/form-password-field.blade.stub delete mode 100644 resources/laravel-code-generator/templates/default/form-pickitems-field.blade.stub delete mode 100644 resources/laravel-code-generator/templates/default/form-pickitems-inline-field.blade.stub delete mode 100644 resources/laravel-code-generator/templates/default/form-request.stub delete mode 100644 resources/laravel-code-generator/templates/default/form-selectmenu-field.blade.stub delete mode 100644 resources/laravel-code-generator/templates/default/form-selectrange-field.blade.stub delete mode 100644 resources/laravel-code-generator/templates/default/form-textarea-field.blade.stub delete mode 100644 resources/laravel-code-generator/templates/default/form.blade.stub delete mode 100644 resources/laravel-code-generator/templates/default/index.blade.stub delete mode 100644 resources/laravel-code-generator/templates/default/index.body.cell.blade.stub delete mode 100644 resources/laravel-code-generator/templates/default/index.header.cell.blade.stub delete mode 100644 resources/laravel-code-generator/templates/default/language.stub delete mode 100644 resources/laravel-code-generator/templates/default/layout.stub delete mode 100644 resources/laravel-code-generator/templates/default/login-partial.stub delete mode 100644 resources/laravel-code-generator/templates/default/migration-schema-down.stub delete mode 100644 resources/laravel-code-generator/templates/default/migration-schema-up.stub delete mode 100644 resources/laravel-code-generator/templates/default/migration.stub delete mode 100644 resources/laravel-code-generator/templates/default/model-accessor-datetime.stub delete mode 100644 resources/laravel-code-generator/templates/default/model-accessor-multiple-answers.stub delete mode 100644 resources/laravel-code-generator/templates/default/model-accessor.stub delete mode 100644 resources/laravel-code-generator/templates/default/model-mutator-datetime.stub delete mode 100644 resources/laravel-code-generator/templates/default/model-mutator-multiple-answers.stub delete mode 100644 resources/laravel-code-generator/templates/default/model-mutator.stub delete mode 100644 resources/laravel-code-generator/templates/default/model-primary-key.stub delete mode 100644 resources/laravel-code-generator/templates/default/model-relation.stub delete mode 100644 resources/laravel-code-generator/templates/default/model-timestamps.stub delete mode 100644 resources/laravel-code-generator/templates/default/model.stub delete mode 100644 resources/laravel-code-generator/templates/default/pagination.blade.stub delete mode 100644 resources/laravel-code-generator/templates/default/routes-8.stub delete mode 100644 resources/laravel-code-generator/templates/default/routes-group.stub delete mode 100644 resources/laravel-code-generator/templates/default/routes.stub delete mode 100644 resources/laravel-code-generator/templates/default/show.blade.stub delete mode 100644 resources/laravel-code-generator/templates/default/show.row.blade.stub delete mode 100644 resources/laravel-code-generator/templates/default/view-model.stub delete mode 100644 resources/views/spatial-plannings/create.blade.php delete mode 100644 resources/views/spatial-plannings/form.blade.php delete mode 100644 resources/views/spatial-plannings/index.blade.php delete mode 100644 resources/views/spatial-plannings/update.blade.php delete mode 100644 resources/views/spatial-plannings/upload.blade.php diff --git a/app/Http/Controllers/Api/SpatialPlanningsController.php b/app/Http/Controllers/Api/SpatialPlanningsController.php deleted file mode 100644 index 9513398..0000000 --- a/app/Http/Controllers/Api/SpatialPlanningsController.php +++ /dev/null @@ -1,103 +0,0 @@ -orderBy('id', 'desc'); - if ($request->has("search") &&!empty($request->get("search"))) { - $query = $query->where("name", "LIKE", "%{$request->get("search")}%") - ->orWhere("nomor", "LIKE", "%{$request->get("search")}%"); - } - return SpatialPlanningsResource::collection($query->paginate()); - } - - public function store(SpatialPlanningsRequest $request) - { - try{ - $validated = $request->validated(); - $data = SpatialPlanning::create($validated); - return response()->json(['message' => 'Successfully created', new SpatialPlanningsResource($data)]); - }catch(\Exception $e){ - return response()->json([ - 'message' => $e->getMessage() - ], 500); - } - } - - /** - * Display the specified resource. - */ - public function show(string $id) - { - // - } - - /** - * Update the specified resource in storage. - */ - public function update(SpatialPlanningsRequest $request, string $id) - { - try{ - $validated = $request->validated(); - $data = SpatialPlanning::find($id); - $data->update($validated); - return response()->json(['message' => 'Successfully updated', new SpatialPlanningsResource($data)]); - }catch(\Exception $e){ - return response()->json([ - 'message' => $e->getMessage() - ], 500); - } - } - - /** - * Remove the specified resource from storage. - */ - public function destroy(string $id) - { - try{ - SpatialPlanning::destroy($id); - return response()->json([ - 'message' => 'Successfully deleted' - ], 200); - }catch(\Exception $e){ - return response()->json([ - 'message' => $e->getMessage() - ], 500); - } - } - - public function upload(ExcelUploadRequest $request){ - try{ - if(!$request->hasFile('file')){ - return response()->json([ - 'error' => 'No file provided' - ], 400); - } - - $file = $request->file('file'); - Excel::import(new SpatialPlanningImport, $file); - return response()->json([ - 'message' => 'Successfully imported' - ], 200); - }catch(\Exception $e){ - return response()->json([ - 'error' => $e->getMessage() - ], 500); - } - } -} diff --git a/app/Http/Controllers/SpatialPlanningsController.php b/app/Http/Controllers/SpatialPlanningsController.php deleted file mode 100644 index acdfc0b..0000000 --- a/app/Http/Controllers/SpatialPlanningsController.php +++ /dev/null @@ -1,28 +0,0 @@ -id(); - $table->string('name'); - $table->string('kbli'); - $table->text('kegiatan'); - $table->decimal('luas',18,2); - $table->text('lokasi'); - $table->string('nomor')->unique(); - $table->date('sp_date'); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::dropIfExists('spatial_plannings'); - } -}; diff --git a/database/seeders/UsersRoleMenuSeeder.php b/database/seeders/UsersRoleMenuSeeder.php index 875061e..17c2c0a 100644 --- a/database/seeders/UsersRoleMenuSeeder.php +++ b/database/seeders/UsersRoleMenuSeeder.php @@ -188,7 +188,7 @@ class UsersRoleMenuSeeder extends Seeder ], [ "name" => "Tata Ruang", - "url" => "spatial-plannings", + "url" => "spatial-plannings.index", "icon" => null, "parent_id" => $data->id, "sort_order" => 6, diff --git a/resources/js/spatial-plannings/create.js b/resources/js/spatial-plannings/create.js deleted file mode 100644 index e8ed4f5..0000000 --- a/resources/js/spatial-plannings/create.js +++ /dev/null @@ -1,69 +0,0 @@ -import flatpickr from "flatpickr"; - -class CreateSpatialPlannings { - constructor() { - this.initCreateSpatial(); - } - - initCreateSpatial() { - const toastNotification = document.getElementById("toastNotification"); - const toast = new bootstrap.Toast(toastNotification); - document - .getElementById("btnCreateSpatialPlannings") - .addEventListener("click", async function () { - let submitButton = this; - let spinner = document.getElementById("spinner"); - let form = document.getElementById( - "formCreateSpatialPlannings" - ); - - if (!form) { - console.error("Form element not found!"); - return; - } - // Get form data - let formData = new FormData(form); - - // Disable button and show spinner - submitButton.disabled = true; - spinner.classList.remove("d-none"); - - try { - let response = await fetch(form.action, { - method: "POST", - headers: { - Authorization: `Bearer ${document - .querySelector('meta[name="api-token"]') - .getAttribute("content")}`, - }, - body: formData, - }); - - if (response.ok) { - let result = await response.json(); - document.getElementById("toast-message").innerText = - result.message; - toast.show(); - setTimeout(() => { - window.location.href = "/data/spatial-plannings"; - }, 2000); - } else { - let error = await response.json(); - document.getElementById("toast-message").innerText = - error.message; - toast.show(); - console.error("Error:", error); - } - } catch (error) { - console.error("Request failed:", error); - document.getElementById("toast-message").innerText = - error.message; - toast.show(); - } - }); - } -} - -document.addEventListener("DOMContentLoaded", function (e) { - new CreateSpatialPlannings(); -}); diff --git a/resources/js/spatial-plannings/index.js b/resources/js/spatial-plannings/index.js deleted file mode 100644 index 51da198..0000000 --- a/resources/js/spatial-plannings/index.js +++ /dev/null @@ -1,156 +0,0 @@ -import { Grid } from "gridjs/dist/gridjs.umd.js"; -import gridjs from "gridjs/dist/gridjs.umd.js"; -import "gridjs/dist/gridjs.umd.js"; -import GlobalConfig from "../global-config"; -import Swal from "sweetalert2"; - -class SpatialPlannings { - constructor() { - this.toastMessage = document.getElementById("toast-message"); - this.toastElement = document.getElementById("toastNotification"); - this.toast = new bootstrap.Toast(this.toastElement); - this.table = null; - - // Initialize functions - this.initTableSpatialPlannings(); - this.initEvents(); - } - initEvents() { - document.body.addEventListener("click", async (event) => { - const deleteButton = event.target.closest( - ".btn-delete-spatial-plannings" - ); - if (deleteButton) { - event.preventDefault(); - await this.handleDelete(deleteButton); - } - }); - } - - initTableSpatialPlannings() { - let tableContainer = document.getElementById("table-spatial-plannings"); - // Create a new Grid.js instance only if it doesn't exist - this.table = new Grid({ - columns: [ - "ID", - "Name", - "KBLI", - "Kegiatan", - "Luas", - "Lokasi", - "Nomor", - "Date", - { - name: "Action", - formatter: (cell) => - gridjs.html(` -
- - - - -
- `), - }, - ], - pagination: { - limit: 15, - server: { - url: (prev, page) => - `${prev}${prev.includes("?") ? "&" : "?"}page=${ - page + 1 - }`, - }, - }, - sort: true, - search: { - server: { - url: (prev, keyword) => `${prev}?search=${keyword}`, - }, - }, - server: { - url: `${GlobalConfig.apiHost}/api/spatial-plannings`, - credentials: "include", - headers: { - Authorization: `Bearer ${document - .querySelector('meta[name="api-token"]') - .getAttribute("content")}`, - "Content-Type": "application/json", - }, - then: (data) => - data.data.map((item) => [ - item.id, - item.name, - item.kbli, - item.kegiatan, - item.luas, - item.lokasi, - item.nomor, - item.sp_date, - item.id, - ]), - total: (data) => data.meta.total, - }, - }).render(tableContainer); - } - - async handleDelete(deleteButton) { - const id = deleteButton.getAttribute("data-id"); - - const result = await Swal.fire({ - title: "Are you sure?", - text: "You won't be able to revert this!", - icon: "warning", - showCancelButton: true, - confirmButtonColor: "#3085d6", - cancelButtonColor: "#d33", - confirmButtonText: "Yes, delete it!", - }); - - if (result.isConfirmed) { - try { - let response = await fetch( - `${GlobalConfig.apiHost}/api/spatial-plannings/${id}`, - { - method: "DELETE", - credentials: "include", - headers: { - Authorization: `Bearer ${document - .querySelector('meta[name="api-token"]') - .getAttribute("content")}`, - "Content-Type": "application/json", - }, - } - ); - - if (response.ok) { - let result = await response.json(); - this.toastMessage.innerText = - result.message || "Deleted successfully!"; - this.toast.show(); - - // Refresh Grid.js table - if (typeof this.table !== "undefined") { - this.table.updateConfig({}).forceRender(); - } - } else { - let error = await response.json(); - console.error("Delete failed:", error); - this.toastMessage.innerText = - error.message || "Delete failed!"; - this.toast.show(); - } - } catch (error) { - console.error("Error deleting item:", error); - this.toastMessage.innerText = "An error occurred!"; - this.toast.show(); - } - } - } -} - -document.addEventListener("DOMContentLoaded", function (e) { - new SpatialPlannings(); -}); diff --git a/resources/js/spatial-plannings/update.js b/resources/js/spatial-plannings/update.js deleted file mode 100644 index 14d56d5..0000000 --- a/resources/js/spatial-plannings/update.js +++ /dev/null @@ -1,67 +0,0 @@ -class UpdateSpatialPlannings { - constructor() { - this.initUpdateSpatial(); - } - - initUpdateSpatial() { - const toastNotification = document.getElementById("toastNotification"); - const toast = new bootstrap.Toast(toastNotification); - document - .getElementById("btnUpdateSpatialPlannings") - .addEventListener("click", async function () { - let submitButton = this; - let spinner = document.getElementById("spinner"); - let form = document.getElementById( - "formUpdateSpatialPlannings" - ); - - if (!form) { - console.error("Form element not found!"); - return; - } - // Get form data - let formData = new FormData(form); - - // Disable button and show spinner - submitButton.disabled = true; - spinner.classList.remove("d-none"); - - try { - let response = await fetch(form.action, { - method: "POST", - headers: { - Authorization: `Bearer ${document - .querySelector('meta[name="api-token"]') - .getAttribute("content")}`, - }, - body: formData, - }); - - if (response.ok) { - let result = await response.json(); - document.getElementById("toast-message").innerText = - result.message; - toast.show(); - setTimeout(() => { - window.location.href = "/data/spatial-plannings"; - }, 2000); - } else { - let error = await response.json(); - document.getElementById("toast-message").innerText = - error.message; - toast.show(); - console.error("Error:", error); - } - } catch (error) { - console.error("Request failed:", error); - document.getElementById("toast-message").innerText = - error.message; - toast.show(); - } - }); - } -} - -document.addEventListener("DOMContentLoaded", function (e) { - new UpdateSpatialPlannings(); -}); diff --git a/resources/js/spatial-plannings/upload.js b/resources/js/spatial-plannings/upload.js deleted file mode 100644 index b8bbc26..0000000 --- a/resources/js/spatial-plannings/upload.js +++ /dev/null @@ -1,83 +0,0 @@ -import { Dropzone } from "dropzone"; -Dropzone.autoDiscover = false; - -class UploadSpatialPlannings { - constructor() { - this.spatialDropzone = null; - this.formElement = document.getElementById( - "formUploadSpatialPlannings" - ); - this.uploadButton = document.getElementById("submit-upload"); - this.spinner = document.getElementById("spinner"); - if (!this.formElement) { - console.error( - "Element formUploadSpatialPlannings tidak ditemukan!" - ); - } - } - - init() { - this.initDropzone(); - this.setupUploadButton(); - } - - initDropzone() { - const toastNotification = document.getElementById("toastNotification"); - const toast = new bootstrap.Toast(toastNotification); - var previewTemplate, - dropzonePreviewNode = document.querySelector( - "#dropzone-preview-list" - ); - (dropzonePreviewNode.id = ""), - dropzonePreviewNode && - ((previewTemplate = dropzonePreviewNode.parentNode.innerHTML), - dropzonePreviewNode.parentNode.removeChild(dropzonePreviewNode), - (this.spatialDropzone = new Dropzone(".dropzone", { - url: this.formElement.action, - method: "post", - acceptedFiles: ".xls,.xlsx", - previewTemplate: previewTemplate, - previewsContainer: "#dropzone-preview", - autoProcessQueue: false, - headers: { - Authorization: `Bearer ${document - .querySelector('meta[name="api-token"]') - .getAttribute("content")}`, - }, - init: function () { - this.on("success", function (file, response) { - document.getElementById("toast-message").innerText = - response.message; - toast.show(); - setTimeout(() => { - window.location.href = - "/data/spatial-plannings"; - }, 2000); - }); - this.on("error", function (file, errorMessage) { - document.getElementById("toast-message").innerText = - errorMessage.message; - toast.show(); - this.uploadButton.disabled = false; - this.spinner.classList.add("d-none"); - }); - }, - }))); - } - - setupUploadButton() { - this.uploadButton.addEventListener("click", (e) => { - if (this.spatialDropzone.files.length > 0) { - this.spatialDropzone.processQueue(); - this.uploadButton.disabled = true; - this.spinner.classList.remove("d-none"); - } else { - return; - } - }); - } -} - -document.addEventListener("DOMContentLoaded", function (e) { - new UploadSpatialPlannings().init(); -}); diff --git a/resources/laravel-code-generator/templates/default/api-controller-base-class.stub b/resources/laravel-code-generator/templates/default/api-controller-base-class.stub deleted file mode 100644 index 5cdad7a..0000000 --- a/resources/laravel-code-generator/templates/default/api-controller-base-class.stub +++ /dev/null @@ -1,15 +0,0 @@ -successResponse( - [% model_was_deleted %], - $this->transform($[% model_name_singular_variable %]) - ); \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/api-controller-call-index-api-resource.stub b/resources/laravel-code-generator/templates/default/api-controller-call-index-api-resource.stub deleted file mode 100644 index 9d01d03..0000000 --- a/resources/laravel-code-generator/templates/default/api-controller-call-index-api-resource.stub +++ /dev/null @@ -1 +0,0 @@ -return new [% api_resource_collection_class %]($[% model_name_plural_variable %], [% models_were_retrieved %]); \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/api-controller-call-index-success-method.stub b/resources/laravel-code-generator/templates/default/api-controller-call-index-success-method.stub deleted file mode 100644 index 1ac32cd..0000000 --- a/resources/laravel-code-generator/templates/default/api-controller-call-index-success-method.stub +++ /dev/null @@ -1,26 +0,0 @@ -$[% data_variable %] = $[% model_name_plural_variable %]->transform(function ($[% model_name_singular_variable %]) { - return $this->transform($[% model_name_singular_variable %]); - }); - - return $this->successResponse( - [% models_were_retrieved %], - $[% data_variable %], - [ - 'links' => [ - 'first' => $[% model_name_plural_variable %]->url(1), - 'last' => $[% model_name_plural_variable %]->url($[% model_name_plural_variable %]->lastPage()), - 'prev' => $[% model_name_plural_variable %]->previousPageUrl(), - 'next' => $[% model_name_plural_variable %]->nextPageUrl(), - ], - 'meta' => - [ - 'current_page' => $[% model_name_plural_variable %]->currentPage(), - 'from' => $[% model_name_plural_variable %]->firstItem(), - 'last_page' => $[% model_name_plural_variable %]->lastPage(), - 'path' => $[% model_name_plural_variable %]->resolveCurrentPath(), - 'per_page' => $[% model_name_plural_variable %]->perPage(), - 'to' => $[% model_name_plural_variable %]->lastItem(), - 'total' => $[% model_name_plural_variable %]->total(), - ], - ] - ); \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/api-controller-call-show-api-resource.stub b/resources/laravel-code-generator/templates/default/api-controller-call-show-api-resource.stub deleted file mode 100644 index c9c453d..0000000 --- a/resources/laravel-code-generator/templates/default/api-controller-call-show-api-resource.stub +++ /dev/null @@ -1 +0,0 @@ -return new [% api_resource_class %]($[% model_name_singular_variable %], [% model_was_retrieved %]); \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/api-controller-call-show-success-method.stub b/resources/laravel-code-generator/templates/default/api-controller-call-show-success-method.stub deleted file mode 100644 index c35ff81..0000000 --- a/resources/laravel-code-generator/templates/default/api-controller-call-show-success-method.stub +++ /dev/null @@ -1,4 +0,0 @@ -return $this->successResponse( - [% model_was_retrieved %], - $this->transform($[% model_name_singular_variable %]) - ); \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/api-controller-call-store-api-resource.stub b/resources/laravel-code-generator/templates/default/api-controller-call-store-api-resource.stub deleted file mode 100644 index 48c1110..0000000 --- a/resources/laravel-code-generator/templates/default/api-controller-call-store-api-resource.stub +++ /dev/null @@ -1 +0,0 @@ -return new [% api_resource_class %]($[% model_name_singular_variable %], [% model_was_added %]); \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/api-controller-call-store-success-method.stub b/resources/laravel-code-generator/templates/default/api-controller-call-store-success-method.stub deleted file mode 100644 index e03ecd1..0000000 --- a/resources/laravel-code-generator/templates/default/api-controller-call-store-success-method.stub +++ /dev/null @@ -1,4 +0,0 @@ -return $this->successResponse( - [% model_was_added %], - $this->transform($[% model_name_singular_variable %]) - ); \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/api-controller-call-update-api-resource.stub b/resources/laravel-code-generator/templates/default/api-controller-call-update-api-resource.stub deleted file mode 100644 index ba91ac7..0000000 --- a/resources/laravel-code-generator/templates/default/api-controller-call-update-api-resource.stub +++ /dev/null @@ -1 +0,0 @@ -return new [% api_resource_class %]($[% model_name_singular_variable %], [% model_was_updated %]); \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/api-controller-call-update-success-method.stub b/resources/laravel-code-generator/templates/default/api-controller-call-update-success-method.stub deleted file mode 100644 index 5ea663a..0000000 --- a/resources/laravel-code-generator/templates/default/api-controller-call-update-success-method.stub +++ /dev/null @@ -1,4 +0,0 @@ -return $this->successResponse( - [% model_was_updated %], - $this->transform($[% model_name_singular_variable %]) - ); \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/api-controller-error-response-method.stub b/resources/laravel-code-generator/templates/default/api-controller-error-response-method.stub deleted file mode 100644 index 8b8879e..0000000 --- a/resources/laravel-code-generator/templates/default/api-controller-error-response-method.stub +++ /dev/null @@ -1,14 +0,0 @@ - /** - * Get an error response - * - * @param mix $message - * - * @return Illuminate\Http\Response - */ - protected function errorResponse($message) - { - return response()->json([ - 'errors' => (array) $message, - 'success' => false, - ], 422); - } diff --git a/resources/laravel-code-generator/templates/default/api-controller-get-validator.stub b/resources/laravel-code-generator/templates/default/api-controller-get-validator.stub deleted file mode 100644 index 4414601..0000000 --- a/resources/laravel-code-generator/templates/default/api-controller-get-validator.stub +++ /dev/null @@ -1,16 +0,0 @@ - - /** - * Gets a new validator instance with the defined rules. - * - * @param [% request_fullname %] $request - * - * @return Illuminate\Support\Facades\Validator - */ - protected function getValidator(Request $request) - { - $rules = [ -[% validation_rules %] - ]; -[% file_validation_snippet %] - return Validator::make($request->all(), $rules); - } diff --git a/resources/laravel-code-generator/templates/default/api-controller-success-response-method.stub b/resources/laravel-code-generator/templates/default/api-controller-success-response-method.stub deleted file mode 100644 index d8609e4..0000000 --- a/resources/laravel-code-generator/templates/default/api-controller-success-response-method.stub +++ /dev/null @@ -1,18 +0,0 @@ - /** - * Get a success response - * - * @param mix $message - * @param mix $data - * @param array $meta - * - * @return Illuminate\Http\Response - */ - protected function successResponse($message, $data, array $meta = []) - { - return response()->json( - array_merge([ - 'data' => $data, - 'message' => $message, - 'success' => true, - ], $meta), 200); - } \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/api-controller-transform-method.stub b/resources/laravel-code-generator/templates/default/api-controller-transform-method.stub deleted file mode 100644 index 950f975..0000000 --- a/resources/laravel-code-generator/templates/default/api-controller-transform-method.stub +++ /dev/null @@ -1,13 +0,0 @@ - /** - * Transform the giving [% model_name %] to public friendly array - * - * @param [% use_full_model_name %] $[% model_name_singular_variable %] - * - * @return array - */ - protected function [% transform_method_name %]([% model_name_class %] $[% model_name_singular_variable %]) - { - return [ -[% model_api_array %] - ]; - } diff --git a/resources/laravel-code-generator/templates/default/api-controller-validate.stub b/resources/laravel-code-generator/templates/default/api-controller-validate.stub deleted file mode 100644 index c582ea6..0000000 --- a/resources/laravel-code-generator/templates/default/api-controller-validate.stub +++ /dev/null @@ -1,5 +0,0 @@ -$validator = $this->getValidator($request); - - if ($validator->fails()) { - return $this->errorResponse($validator->errors()->all()); - } diff --git a/resources/laravel-code-generator/templates/default/api-controller.stub b/resources/laravel-code-generator/templates/default/api-controller.stub deleted file mode 100644 index ad86836..0000000 --- a/resources/laravel-code-generator/templates/default/api-controller.stub +++ /dev/null @@ -1,104 +0,0 @@ -errorResponse([% unexpected_error %]); - } - } - - /** - * Display the specified [% model_name %]. - * - * @param int $id - * - * @return Illuminate\Http\Response - */ - public function show($id) - { - $[% model_name_singular_variable %] = [% model_name_class %]::[% with_relations_for_show %]findOrFail($id); - - [% show_return_success %] - } - - /** - * Update the specified [% model_name %] in the storage. - * - * @param int $id - * @param [% request_fullname %] [% request_variable %] - * - * @return Illuminate\Http\Response - */ - public function update($id, [% type_hinted_request_name %]) - { - try { - [% validator_request %] - $[% data_variable %] = [% call_get_data %]; - [% on_update_setter %] - $[% model_name_singular_variable %] = [% model_name_class %]::findOrFail($id); - $[% model_name_singular_variable %]->update($[% data_variable %]); - - [% update_return_success %] - } catch (Exception $exception) { - return $this->errorResponse([% unexpected_error %]); - } - } - - /** - * Remove the specified [% model_name %] from the storage. - * - * @param int $id - * - * @return Illuminate\Http\Response - */ - public function destroy($id) - { - try { - $[% model_name_singular_variable %] = [% model_name_class %]::findOrFail($id); - $[% model_name_singular_variable %]->delete(); - - [% destroy_return_success %] - } catch (Exception $exception) { - return $this->errorResponse([% unexpected_error %]); - } - } -[% get_validator_method %] -[% get_data_method %] -[% upload_method %] -[% transform_method %] -[% response_methods %] -} diff --git a/resources/laravel-code-generator/templates/default/api-documentation-controller-version-based.stub b/resources/laravel-code-generator/templates/default/api-documentation-controller-version-based.stub deleted file mode 100644 index d7c8117..0000000 --- a/resources/laravel-code-generator/templates/default/api-documentation-controller-version-based.stub +++ /dev/null @@ -1,21 +0,0 @@ -getVersion($version)); - - return view($viewName); - } -} diff --git a/resources/laravel-code-generator/templates/default/api-documentation-controller.stub b/resources/laravel-code-generator/templates/default/api-documentation-controller.stub deleted file mode 100644 index 1b27cfe..0000000 --- a/resources/laravel-code-generator/templates/default/api-documentation-controller.stub +++ /dev/null @@ -1,20 +0,0 @@ -[% required_title %] \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/api-documentation-index-authentication.stub b/resources/laravel-code-generator/templates/default/api-documentation-index-authentication.stub deleted file mode 100644 index eb6a978..0000000 --- a/resources/laravel-code-generator/templates/default/api-documentation-index-authentication.stub +++ /dev/null @@ -1,11 +0,0 @@ - - Authorization - [% string_title %] - - [% header_title %] - - [% access_token_with_bearer %] - @if(isset($showValidation) && $showValidation) - - @endif - diff --git a/resources/laravel-code-generator/templates/default/api-documentation-index-failed-authentication.stub b/resources/laravel-code-generator/templates/default/api-documentation-index-failed-authentication.stub deleted file mode 100644 index e412621..0000000 --- a/resources/laravel-code-generator/templates/default/api-documentation-index-failed-authentication.stub +++ /dev/null @@ -1,16 +0,0 @@ -

401 - Unauthorized

-

[% the_user_does_not_have_permission_to_access_the_requested_resource %]

- - - - - - - - - - - - - -
success[% boolean_title %][% indicate_whether_the_request_was_successful_or_not %]
error[% array_of_strings %][% the_error_message %]
diff --git a/resources/laravel-code-generator/templates/default/api-documentation-index-failed-to-retrieve.stub b/resources/laravel-code-generator/templates/default/api-documentation-index-failed-to-retrieve.stub deleted file mode 100644 index d94ce7a..0000000 --- a/resources/laravel-code-generator/templates/default/api-documentation-index-failed-to-retrieve.stub +++ /dev/null @@ -1,16 +0,0 @@ -

202 - Accepted

-

[% the_requested_model_does_not_exists %]

- - - - - - - - - - - - - -
success[% boolean_title %][% indicate_whether_the_request_was_successful_or_not %]
error[% array_of_strings %][% the_error_message %]
diff --git a/resources/laravel-code-generator/templates/default/api-documentation-index-failed-validation.stub b/resources/laravel-code-generator/templates/default/api-documentation-index-failed-validation.stub deleted file mode 100644 index 06c98b6..0000000 --- a/resources/laravel-code-generator/templates/default/api-documentation-index-failed-validation.stub +++ /dev/null @@ -1,16 +0,0 @@ -

422 - Unprocessable Entity

-

[% the_request_failed_validation %]

- - - - - - - - - - - - - -
success[% boolean_title %][% indicate_whether_the_request_was_successful_or_not %]
errors[% array_of_strings %][% list_of_the_invalid_errors %]
diff --git a/resources/laravel-code-generator/templates/default/api-documentation-index-fields-list-body-row-for-model.stub b/resources/laravel-code-generator/templates/default/api-documentation-index-fields-list-body-row-for-model.stub deleted file mode 100644 index 125a36d..0000000 --- a/resources/laravel-code-generator/templates/default/api-documentation-index-fields-list-body-row-for-model.stub +++ /dev/null @@ -1,5 +0,0 @@ - - [% field_name %] - [% field_type_title %] - [% api_field_description %] - diff --git a/resources/laravel-code-generator/templates/default/api-documentation-index-fields-list-body-row.stub b/resources/laravel-code-generator/templates/default/api-documentation-index-fields-list-body-row.stub deleted file mode 100644 index 21c2c77..0000000 --- a/resources/laravel-code-generator/templates/default/api-documentation-index-fields-list-body-row.stub +++ /dev/null @@ -1,12 +0,0 @@ - - [% field_name %] - [% field_type_title %] - [% body_title %] - [% api_field_description %] - @if($showValidation) - - [% validation_rule_required %] - [% validation_rules %] - - @endif - diff --git a/resources/laravel-code-generator/templates/default/api-documentation-index-fields-list.stub b/resources/laravel-code-generator/templates/default/api-documentation-index-fields-list.stub deleted file mode 100644 index c7c5429..0000000 --- a/resources/laravel-code-generator/templates/default/api-documentation-index-fields-list.stub +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - @if($showValidation) - - @endif - - - - [% include_parameter_for_authorized_request %] - @if(isset($withPathId) && $withPathId) - - - - - - @if($showValidation) - - @endif - - - @endif - - [% fields_list_for_body %] - - - -
[% parameter_name_title %][% data_type_title %][% parameter_type_title %][% description_title %][% validation_title %]
[% model_name %][% primary_key_type_title %][% path_title %][% the_id_of_the_model %] - [% validation_rule_required %] -
diff --git a/resources/laravel-code-generator/templates/default/api-documentation-index-request.stub b/resources/laravel-code-generator/templates/default/api-documentation-index-request.stub deleted file mode 100644 index bd1278a..0000000 --- a/resources/laravel-code-generator/templates/default/api-documentation-index-request.stub +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - [% include_parameter_for_authorized_request %] - - -
[% parameter_name_title %][% data_type_title %][% parameter_type_title %][% description_title %]
diff --git a/resources/laravel-code-generator/templates/default/api-documentation-index-retrieved-fields-body-row.stub b/resources/laravel-code-generator/templates/default/api-documentation-index-retrieved-fields-body-row.stub deleted file mode 100644 index 125a36d..0000000 --- a/resources/laravel-code-generator/templates/default/api-documentation-index-retrieved-fields-body-row.stub +++ /dev/null @@ -1,5 +0,0 @@ - - [% field_name %] - [% field_type_title %] - [% api_field_description %] - diff --git a/resources/laravel-code-generator/templates/default/api-documentation-index-retrieved-fields.stub b/resources/laravel-code-generator/templates/default/api-documentation-index-retrieved-fields.stub deleted file mode 100644 index 0c93577..0000000 --- a/resources/laravel-code-generator/templates/default/api-documentation-index-retrieved-fields.stub +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - -[% fields_list_for_body %] - -
[% name_title %][% type_title %][% description_title %]
diff --git a/resources/laravel-code-generator/templates/default/api-documentation-index-retrieved.stub b/resources/laravel-code-generator/templates/default/api-documentation-index-retrieved.stub deleted file mode 100644 index 2c8cd87..0000000 --- a/resources/laravel-code-generator/templates/default/api-documentation-index-retrieved.stub +++ /dev/null @@ -1,21 +0,0 @@ -

200 - Ok

-

[% request_was_successful %]

- - - - - - - - - - - - - - - - - - -
success[% boolean_title %][% indicate_whether_the_request_was_successful_or_not %]
message[% string_title %][% the_success_message %]
data[% array_title %][% the_key_is_the_model_property_and_the_value_is_the_model_value %]
diff --git a/resources/laravel-code-generator/templates/default/api-documentation-index.stub b/resources/laravel-code-generator/templates/default/api-documentation-index.stub deleted file mode 100644 index 2816e9f..0000000 --- a/resources/laravel-code-generator/templates/default/api-documentation-index.stub +++ /dev/null @@ -1,386 +0,0 @@ -@extends('[% layout_name %]') - -@section('content') - -

[% model_plural %]

-[% general_description %] -
- -

[% available_resources %]

-
- -
-
- GET - /{{ Route::getRoutes()->getByName('[% index_route_name %]')->uri() }} -

[% index_route_description %]

-
-
- -
-
- -
-

[% request_title %]

- [% authorized_request_for_index %] - -
-

[% response_title %]

- -

[% index_route_response_description %]

-

- -

200 - Ok

-

[% request_was_successful %]

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
success[% boolean_title %]Was the request successful or not.
message[% string_title %][% the_success_message %]
data[% array_title %] - [% the_key_is_the_model_property_and_the_value_is_the_model_value %] -
links[% array_title %] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[% key_title %][% data_type_title %][% description_title %]
first[% string_title %][% link_to_retrieve_first_page %]
last[% string_title %][% link_to_retrieve_last_page %]
prev[% string_title %][% link_to_retrieve_previous_page %]
next[% string_title %][% link_to_retrieve_next_page %]
- -
meta[% array_title %] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[% key_title %][% data_type_title %][% description_title %]
current_page[% integer_title %][% the_number_of_current_page %]
from[% integer_title %][% the_index_of_the_first_retrieved_item %]
last_page[% integer_title %][% the_number_of_the_last_page %]
Path[% string_title %][% the_base_link_to_the_resource %]
per_page[% integer_title %][% the_number_of_models_per_page %]
to[% integer_title %][% the_index_of_the_last_retrieved_item %]
total[% integer_title %][% the_total_of_available_pages %]
- -
- - [% include_failed_authentication_for_authorized_request %] - -
-
- - -
- -
-
- POST - /{{ Route::getRoutes()->getByName('[% store_route_name %]')->uri() }} -

[% store_route_description %]

-
-
- -
-
- -
-

[% request_title %]

- - @include('[% path_to_view_home %]fields-list', [ - 'withValidation' => true - ]) - -
-

[% response_title %]

-

[% store_route_response_description %]

-

- - @include('[% path_to_view_home %]retrieved') - @include('[% path_to_view_home %]failed-to-retrieve') - @include('[% path_to_view_home %]failed-validation') - [% include_failed_authentication_for_authorized_request %] - -
-
- - - -
- -
-
- POST - /{{ Route::getRoutes()->getByName('[% update_route_name %]')->uri() }} -

[% update_route_description %]

-
-
- -
-
- -
-
- -

[% request_title %]

- - @include('[% path_to_view_home %]fields-list', [ - 'withValidation' => true, - 'withPathId' => true, - ]) - -
-

[% response_title %]

-

[% update_route_response_description %]

-

- - @include('[% path_to_view_home %]retrieved') - @include('[% path_to_view_home %]failed-to-retrieve') - @include('[% path_to_view_home %]failed-validation') - [% include_failed_authentication_for_authorized_request %] - -
-
-
- - - -
- -
-
- GET - /{{ Route::getRoutes()->getByName('[% show_route_name %]')->uri() }} -

[% show_route_description %]

-
-
- -
-
- -
- -

[% request_title %]

- - - - - - - - - - - - [% include_parameter_for_authorized_request %] - - - - - - - -
[% parameter_name_title %][% data_type_title %][% parameter_type_title %][% description_title %]
[% model_name %][% integer_title %][% path_title %][% the_id_of_model_to_retrieve %]
- - -
-

[% response_title %]

-

[% show_route_response_description %]

-

- - @include('[% path_to_view_home %]retrieved') - @include('[% path_to_view_home %]failed-to-retrieve') - [% include_failed_authentication_for_authorized_request %] - -
-
- - -
- -
-
- DELETE - /{{ Route::getRoutes()->getByName('[% destroy_route_name %]')->uri() }} -

[% destroy_route_description %]

-
-
- -
-
- -
- -

[% request_title %]

- - - - - - - - - - - - [% include_parameter_for_authorized_request %] - - - - - - - -
[% parameter_name_title %][% data_type_title %][% parameter_type_title %][% description_title %]
[% model_name %][% integer_title %][% path_title %][% the_id_of_model_to_delete %]
- - -
-

[% response_title %]

-

[% destroy_route_response_description %]

-

- - @include('[% path_to_view_home %]retrieved') - @include('[% path_to_view_home %]failed-to-retrieve') - [% include_failed_authentication_for_authorized_request %] - -
- -
- -
- -

[% model_definition_title %]

-
- -
-
- [% model_name_title %] -
-
- -
-
- -
- - - - - - - - - - [% fields_list_for_body %] - -
[% field_name_title %][% field_type_title %][% description_title %]
-
-
- -@endsection diff --git a/resources/laravel-code-generator/templates/default/api-documentation-routes-8.stub b/resources/laravel-code-generator/templates/default/api-documentation-routes-8.stub deleted file mode 100644 index 1e3291f..0000000 --- a/resources/laravel-code-generator/templates/default/api-documentation-routes-8.stub +++ /dev/null @@ -1,2 +0,0 @@ -Route::get('[% prefix %][% version %]', [[% controller_name %]::class, 'index']) - ->name('[% index_route_name %]'); diff --git a/resources/laravel-code-generator/templates/default/api-documentation-routes.stub b/resources/laravel-code-generator/templates/default/api-documentation-routes.stub deleted file mode 100644 index d74d23f..0000000 --- a/resources/laravel-code-generator/templates/default/api-documentation-routes.stub +++ /dev/null @@ -1,2 +0,0 @@ -Route::get('[% prefix %][% version %]', '[% controller_name %]@index') - ->name('[% index_route_name %]'); diff --git a/resources/laravel-code-generator/templates/default/api-documentation-version-based-base-controller.stub b/resources/laravel-code-generator/templates/default/api-documentation-version-based-base-controller.stub deleted file mode 100644 index 9f4201d..0000000 --- a/resources/laravel-code-generator/templates/default/api-documentation-version-based-base-controller.stub +++ /dev/null @@ -1,38 +0,0 @@ -versions)) { - return $version; - } - - return end($this->versions); - } -} \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/api-resource-collection.stub b/resources/laravel-code-generator/templates/default/api-resource-collection.stub deleted file mode 100644 index f6f8578..0000000 --- a/resources/laravel-code-generator/templates/default/api-resource-collection.stub +++ /dev/null @@ -1,50 +0,0 @@ -message = $message; - } - - /** - * Transform the resource collection into an array. - * - * @param \Illuminate\Http\Request - * @return array - */ - public function toArray($request) - { - return [ - 'data' => $this->collection->transform(function ($[% model_name_singular_variable %]) { - return $this->transformModel($[% model_name_singular_variable %]); - }), - 'message' => $this->message, - 'success' => true, - ]; - } - -[% transform_method %] -} diff --git a/resources/laravel-code-generator/templates/default/api-resource.stub b/resources/laravel-code-generator/templates/default/api-resource.stub deleted file mode 100644 index addba74..0000000 --- a/resources/laravel-code-generator/templates/default/api-resource.stub +++ /dev/null @@ -1,59 +0,0 @@ -message = $message; - } - - /** - * Transform the resource into an array. - * - * @param \Illuminate\Http\Request $request - * - * @return array - */ - public function toArray($request) - { - return [ -[% model_api_array %] - ]; - } - - /** - * Get any additional data that should be returned with the resource array. - * - * @param \Illuminate\Http\Request $request - * - * @return array - */ - public function with($request) - { - return [ - 'success' => true, - 'message' => $this->message, - ]; - } -} diff --git a/resources/laravel-code-generator/templates/default/api-routes-8.stub b/resources/laravel-code-generator/templates/default/api-routes-8.stub deleted file mode 100644 index 28e3886..0000000 --- a/resources/laravel-code-generator/templates/default/api-routes-8.stub +++ /dev/null @@ -1,10 +0,0 @@ - Route::get('/', [[% controller_name %]::class, 'index']) - ->name('[% index_route_name %]'); - Route::get('/show/{[% model_name_singular_variable %]}',[[% controller_name %]::class, 'show']) - ->name('[% show_route_name %]')[% route_id_clause %]; - Route::post('/', [[% controller_name %]::class, 'store']) - ->name('[% store_route_name %]'); - Route::put('[% model_name_snake %]/{[% model_name_singular_variable %]}', [[% controller_name %]::class, 'update']) - ->name('[% update_route_name %]')[% route_id_clause %]; - Route::delete('/[% model_name_snake %]/{[% model_name_singular_variable %]}',[[% controller_name %]::class, 'destroy']) - ->name('[% destroy_route_name %]')[% route_id_clause %]; \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/api-routes.stub b/resources/laravel-code-generator/templates/default/api-routes.stub deleted file mode 100644 index bd4043d..0000000 --- a/resources/laravel-code-generator/templates/default/api-routes.stub +++ /dev/null @@ -1,10 +0,0 @@ - Route::get('/', '[% controller_name %]@index') - ->name('[% index_route_name %]'); - Route::get('/show/{[% model_name_singular_variable %]}','[% controller_name %]@show') - ->name('[% show_route_name %]')[% route_id_clause %]; - Route::post('/', '[% controller_name %]@store') - ->name('[% store_route_name %]'); - Route::put('[% model_name_snake %]/{[% model_name_singular_variable %]}', '[% controller_name %]@update') - ->name('[% update_route_name %]')[% route_id_clause %]; - Route::delete('/[% model_name_snake %]/{[% model_name_singular_variable %]}','[% controller_name %]@destroy') - ->name('[% destroy_route_name %]')[% route_id_clause %]; \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/controller-affirm-method.stub b/resources/laravel-code-generator/templates/default/controller-affirm-method.stub deleted file mode 100644 index 7d4f94f..0000000 --- a/resources/laravel-code-generator/templates/default/controller-affirm-method.stub +++ /dev/null @@ -1,17 +0,0 @@ - - /** - * Validate the given request with the defined rules. - * - * @param [% request_fullname %] $request - * - * @return boolean - */ - protected function affirm(Request $request) - { - $rules = [ -[% validation_rules %] - ]; -[% file_validation_snippet %] - - return $this->validate($request, $rules); - } diff --git a/resources/laravel-code-generator/templates/default/controller-constructor.stub b/resources/laravel-code-generator/templates/default/controller-constructor.stub deleted file mode 100644 index a670bb3..0000000 --- a/resources/laravel-code-generator/templates/default/controller-constructor.stub +++ /dev/null @@ -1,10 +0,0 @@ - /** - * Create a new controller instance. - * - * @return void - */ - public function __construct() - { - [% auth_middleware %] - } - \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/controller-getdata-method-5.5.stub b/resources/laravel-code-generator/templates/default/controller-getdata-method-5.5.stub deleted file mode 100644 index 3295ab8..0000000 --- a/resources/laravel-code-generator/templates/default/controller-getdata-method-5.5.stub +++ /dev/null @@ -1,21 +0,0 @@ - - /** - * Get the request's data from the request. - * - * [% request_name_comment %] - * @return array - */ - [% visibility_level %] function getData([% type_hinted_request_name %]) - { - $rules = [ - [% validation_rules %] - ]; - - [% file_validation_snippet %] - $data = [% request_variable %]->validate($rules); - -[% file_snippet %] -[% boolean_snippet %] -[% string_to_null_snippet %] - return $data; - } \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/controller-getdata-method.stub b/resources/laravel-code-generator/templates/default/controller-getdata-method.stub deleted file mode 100644 index f35cf67..0000000 --- a/resources/laravel-code-generator/templates/default/controller-getdata-method.stub +++ /dev/null @@ -1,15 +0,0 @@ - - /** - * Get the request's data from the request. - * - * [% request_name_comment %] - * @return array - */ - [% visibility_level %] function getData([% type_hinted_request_name %]) - { - $data = [% request_variable %]->only([% fillable %]); -[% file_snippet %] -[% boolean_snippet %] -[% string_to_null_snippet %] - return $data; - } \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/controller-upload-method-5.3.stub b/resources/laravel-code-generator/templates/default/controller-upload-method-5.3.stub deleted file mode 100644 index 45b9a51..0000000 --- a/resources/laravel-code-generator/templates/default/controller-upload-method-5.3.stub +++ /dev/null @@ -1,19 +0,0 @@ - - /** - * Moves the attached file to the server. - * - * @param \Symfony\Component\HttpFoundation\File\UploadedFile $file - * - * @return string - */ - protected function moveFile($file) - { - if (!$file->isValid()) { - return ''; - } - - $path = config('laravel-code-generator.files_upload_path', 'uploads'); - $saved = $file->store('public/' . $path, config('filesystems.default')); - - return substr($saved, 7); - } diff --git a/resources/laravel-code-generator/templates/default/controller-upload-method.stub b/resources/laravel-code-generator/templates/default/controller-upload-method.stub deleted file mode 100644 index 3354a45..0000000 --- a/resources/laravel-code-generator/templates/default/controller-upload-method.stub +++ /dev/null @@ -1,20 +0,0 @@ - - /** - * Moves the attached file to the server. - * - * @param \Symfony\Component\HttpFoundation\File\UploadedFile $file - * - * @return string - */ - protected function moveFile($file) - { - if (!$file->isValid()) { - return ''; - } - - $fileName = sprintf('%s.%s', uniqid(), $file->getClientOriginalExtension()); - $destinationPath = config('laravel-code-generator.files_upload_path','uploads'); - $path = $file->move($destinationPath, $fileName); - - return $destinationPath . '/' . $fileName; - } \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/controller.stub b/resources/laravel-code-generator/templates/default/controller.stub deleted file mode 100644 index fbd784e..0000000 --- a/resources/laravel-code-generator/templates/default/controller.stub +++ /dev/null @@ -1,126 +0,0 @@ -route('[% index_route_name %]') - ->with('success_message', [% model_was_added %]); - } - - /** - * Display the specified [% model_name %]. - * - * @param int $id - * - * @return \Illuminate\View\View - */ - public function show($id) - { - $[% model_name_singular_variable %] = [% model_name_class %]::[% with_relations_for_show %]findOrFail($id); - - return view('[% show_view_name %]'[% view_variables_for_show %]); - } - - /** - * Show the form for editing the specified [% model_name %]. - * - * @param int $id - * - * @return \Illuminate\View\View - */ - public function edit($id) - { - $[% model_name_singular_variable %] = [% model_name_class %]::findOrFail($id); - [% relation_collections %] - - return view('[% edit_view_name %]'[% view_variables_for_edit %]); - } - - /** - * Update the specified [% model_name %] in the storage. - * - * @param int $id - * @param [% request_fullname %] [% request_variable %] - * - * @return \Illuminate\Http\RedirectResponse | \Illuminate\Routing\Redirector - */ - public function update($id, [% type_hinted_request_name %]) - { - [% call_affirm %] - $[% data_variable %] = [% call_get_data %]; - [% on_update_setter %] - $[% model_name_singular_variable %] = [% model_name_class %]::findOrFail($id); - $[% model_name_singular_variable %]->update($[% data_variable %]); - - return redirect()->route('[% index_route_name %]') - ->with('success_message', [% model_was_updated %]); - } - - /** - * Remove the specified [% model_name %] from the storage. - * - * @param int $id - * - * @return \Illuminate\Http\RedirectResponse | \Illuminate\Routing\Redirector - */ - public function destroy($id) - { - try { - $[% model_name_singular_variable %] = [% model_name_class %]::findOrFail($id); - $[% model_name_singular_variable %]->delete(); - - return redirect()->route('[% index_route_name %]') - ->with('success_message', [% model_was_deleted %]); - } catch (Exception $exception) { - - return back()->withInput() - ->withErrors(['unexpected_error' => [% unexpected_error %]]); - } - } -[% affirm_method %] -[% get_data_method %] -[% upload_method %] -} diff --git a/resources/laravel-code-generator/templates/default/create.blade.stub b/resources/laravel-code-generator/templates/default/create.blade.stub deleted file mode 100644 index ac5dfc4..0000000 --- a/resources/laravel-code-generator/templates/default/create.blade.stub +++ /dev/null @@ -1,46 +0,0 @@ -@extends('[% layout_name %]') - -@section('content') - -
- -
-

[% create_model %]

-
- - - -
-
- - -
- - @if ($errors->any()) - - @endif - -
- {{ csrf_field() }} - @include ('[% form_view_name %]', [ - '[% model_name_singular_variable %]' => null, - ]) - -
- -
- -
- -
-
- -@endsection - - diff --git a/resources/laravel-code-generator/templates/default/edit.blade.stub b/resources/laravel-code-generator/templates/default/edit.blade.stub deleted file mode 100644 index 081642d..0000000 --- a/resources/laravel-code-generator/templates/default/edit.blade.stub +++ /dev/null @@ -1,47 +0,0 @@ -@extends('[% layout_name %]') - -@section('content') - -
- -
-

{{ !empty([% model_header %]) ? [% model_header %] : '[% model_name_title %]' }}

-
- - - - - - - -
-
- -
- - @if ($errors->any()) - - @endif - -
- {{ csrf_field() }} - - @include ('[% form_view_name %]', [ - '[% model_name_singular_variable %]' => $[% model_name_singular_variable %], - ]) - -
- -
-
- -
-
- -@endsection \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/form-file-field.blade.stub b/resources/laravel-code-generator/templates/default/form-file-field.blade.stub deleted file mode 100644 index 06fe6cf..0000000 --- a/resources/laravel-code-generator/templates/default/form-file-field.blade.stub +++ /dev/null @@ -1,14 +0,0 @@ -
- -
- - @if (isset($[% model_name_singular_variable %]->[% field_name %]) && !empty($[% model_name_singular_variable %]->[% field_name %])) - -
-
- -
- -
- - @endif diff --git a/resources/laravel-code-generator/templates/default/form-helper-field.blade.stub b/resources/laravel-code-generator/templates/default/form-helper-field.blade.stub deleted file mode 100644 index d34652f..0000000 --- a/resources/laravel-code-generator/templates/default/form-helper-field.blade.stub +++ /dev/null @@ -1 +0,0 @@ - {!! $errors->first('[% field_name %]', '
:message
') !!} \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/form-input-field.blade.stub b/resources/laravel-code-generator/templates/default/form-input-field.blade.stub deleted file mode 100644 index fd62a05..0000000 --- a/resources/laravel-code-generator/templates/default/form-input-field.blade.stub +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/form-input-wrapper.blade.stub b/resources/laravel-code-generator/templates/default/form-input-wrapper.blade.stub deleted file mode 100644 index ac7c9cf..0000000 --- a/resources/laravel-code-generator/templates/default/form-input-wrapper.blade.stub +++ /dev/null @@ -1,8 +0,0 @@ - -
-[% field_label %] -
-[% field_input %] -[% field_validation_helper %] -
-
diff --git a/resources/laravel-code-generator/templates/default/form-label-field.blade.stub b/resources/laravel-code-generator/templates/default/form-label-field.blade.stub deleted file mode 100644 index b48e5f3..0000000 --- a/resources/laravel-code-generator/templates/default/form-label-field.blade.stub +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/form-month-field.blade.stub b/resources/laravel-code-generator/templates/default/form-month-field.blade.stub deleted file mode 100644 index 8ba00e6..0000000 --- a/resources/laravel-code-generator/templates/default/form-month-field.blade.stub +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/resources/laravel-code-generator/templates/default/form-nolabel-field.blade.stub b/resources/laravel-code-generator/templates/default/form-nolabel-field.blade.stub deleted file mode 100644 index e1ad396..0000000 --- a/resources/laravel-code-generator/templates/default/form-nolabel-field.blade.stub +++ /dev/null @@ -1 +0,0 @@ -
\ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/form-password-field.blade.stub b/resources/laravel-code-generator/templates/default/form-password-field.blade.stub deleted file mode 100644 index 6f87c4e..0000000 --- a/resources/laravel-code-generator/templates/default/form-password-field.blade.stub +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/form-pickitems-field.blade.stub b/resources/laravel-code-generator/templates/default/form-pickitems-field.blade.stub deleted file mode 100644 index e8c4fc2..0000000 --- a/resources/laravel-code-generator/templates/default/form-pickitems-field.blade.stub +++ /dev/null @@ -1,6 +0,0 @@ -
- - -
diff --git a/resources/laravel-code-generator/templates/default/form-pickitems-inline-field.blade.stub b/resources/laravel-code-generator/templates/default/form-pickitems-inline-field.blade.stub deleted file mode 100644 index 08568c6..0000000 --- a/resources/laravel-code-generator/templates/default/form-pickitems-inline-field.blade.stub +++ /dev/null @@ -1,6 +0,0 @@ -
- - -
diff --git a/resources/laravel-code-generator/templates/default/form-request.stub b/resources/laravel-code-generator/templates/default/form-request.stub deleted file mode 100644 index 22ecfd7..0000000 --- a/resources/laravel-code-generator/templates/default/form-request.stub +++ /dev/null @@ -1,35 +0,0 @@ -has('[% field_name %]') ? ' is-invalid' : '' }}[% css_class %]" id="[% field_name %]" name="[% field_name %]"[% field_multiple %][% required_field %]> - [% placeholder %] - @foreach ([% field_items %] as $key => [% field_item %]) - - @endforeach - - \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/form-selectrange-field.blade.stub b/resources/laravel-code-generator/templates/default/form-selectrange-field.blade.stub deleted file mode 100644 index c35ab34..0000000 --- a/resources/laravel-code-generator/templates/default/form-selectrange-field.blade.stub +++ /dev/null @@ -1,9 +0,0 @@ - - \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/form-textarea-field.blade.stub b/resources/laravel-code-generator/templates/default/form-textarea-field.blade.stub deleted file mode 100644 index 1f1d3e5..0000000 --- a/resources/laravel-code-generator/templates/default/form-textarea-field.blade.stub +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/form.blade.stub b/resources/laravel-code-generator/templates/default/form.blade.stub deleted file mode 100644 index ad6d762..0000000 --- a/resources/laravel-code-generator/templates/default/form.blade.stub +++ /dev/null @@ -1 +0,0 @@ -[% form_fields_html %] diff --git a/resources/laravel-code-generator/templates/default/index.blade.stub b/resources/laravel-code-generator/templates/default/index.blade.stub deleted file mode 100644 index 7eae1a6..0000000 --- a/resources/laravel-code-generator/templates/default/index.blade.stub +++ /dev/null @@ -1,78 +0,0 @@ -@extends('[% layout_name %]') - -@section('content') - - @if(Session::has('success_message')) - - @endif - -
- -
-

[% model_name_plural_title %]

-
- - - -
-
- - @if(count($[% model_name_plural_variable %]) == 0) -
-

[% no_models_available %]

-
- @else -
-
- - - - -[% header_cells %] - - - - - @foreach($[% model_name_plural_variable %] as $[% model_name_singular_variable %]) - -[% body_cells %] - - - @endforeach - -
- -
- - {{ csrf_field() }} - -
- - - - - - - - -
- -
- -
- -
- - {!! $[% model_name_plural_variable %]->links('[% pagination_view_name %]') !!} -
- - @endif - -
-@endsection \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/index.body.cell.blade.stub b/resources/laravel-code-generator/templates/default/index.body.cell.blade.stub deleted file mode 100644 index 99bdccb..0000000 --- a/resources/laravel-code-generator/templates/default/index.body.cell.blade.stub +++ /dev/null @@ -1 +0,0 @@ - {{ [% field_value %] }} \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/index.header.cell.blade.stub b/resources/laravel-code-generator/templates/default/index.header.cell.blade.stub deleted file mode 100644 index 8ca0b94..0000000 --- a/resources/laravel-code-generator/templates/default/index.header.cell.blade.stub +++ /dev/null @@ -1 +0,0 @@ - [% field_title %] \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/language.stub b/resources/laravel-code-generator/templates/default/language.stub deleted file mode 100644 index 4a711de..0000000 --- a/resources/laravel-code-generator/templates/default/language.stub +++ /dev/null @@ -1,5 +0,0 @@ - - - - - - - {{ config('app.name', '[% application_name %]') }} - - - - {{-- --}} - - - - - -
- @yield('content') -
- - - {{-- --}} - - diff --git a/resources/laravel-code-generator/templates/default/login-partial.stub b/resources/laravel-code-generator/templates/default/login-partial.stub deleted file mode 100644 index 86f73df..0000000 --- a/resources/laravel-code-generator/templates/default/login-partial.stub +++ /dev/null @@ -1,10 +0,0 @@ -@if (Route::has('login')) - -@endif \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/migration-schema-down.stub b/resources/laravel-code-generator/templates/default/migration-schema-down.stub deleted file mode 100644 index 22fa175..0000000 --- a/resources/laravel-code-generator/templates/default/migration-schema-down.stub +++ /dev/null @@ -1 +0,0 @@ -Schema::[% connection_name %]drop('[% table_name %]'); \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/migration-schema-up.stub b/resources/laravel-code-generator/templates/default/migration-schema-up.stub deleted file mode 100644 index 871cdc3..0000000 --- a/resources/laravel-code-generator/templates/default/migration-schema-up.stub +++ /dev/null @@ -1,4 +0,0 @@ -Schema::[% connection_name %][% operation_name %]('[% table_name %]', function(Blueprint $table) - { -[% blue_print_body %] - }); \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/migration.stub b/resources/laravel-code-generator/templates/default/migration.stub deleted file mode 100644 index 43bfce1..0000000 --- a/resources/laravel-code-generator/templates/default/migration.stub +++ /dev/null @@ -1,27 +0,0 @@ -getDateFormat(), $value)->format('[% date_format %]'); \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/model-accessor-multiple-answers.stub b/resources/laravel-code-generator/templates/default/model-accessor-multiple-answers.stub deleted file mode 100644 index bb17361..0000000 --- a/resources/laravel-code-generator/templates/default/model-accessor-multiple-answers.stub +++ /dev/null @@ -1 +0,0 @@ -return json_decode($value) ?: []; \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/model-accessor.stub b/resources/laravel-code-generator/templates/default/model-accessor.stub deleted file mode 100644 index cd9c029..0000000 --- a/resources/laravel-code-generator/templates/default/model-accessor.stub +++ /dev/null @@ -1,10 +0,0 @@ - /** - * Get [% field_name %] in array format - * - * @param string $value - * @return array - */ - public function get[% field_name_cap %]Attribute($value) - { - [% content %] - } diff --git a/resources/laravel-code-generator/templates/default/model-mutator-datetime.stub b/resources/laravel-code-generator/templates/default/model-mutator-datetime.stub deleted file mode 100644 index 538687d..0000000 --- a/resources/laravel-code-generator/templates/default/model-mutator-datetime.stub +++ /dev/null @@ -1 +0,0 @@ -$this->attributes['[% field_name %]'] = !empty($value) ? \DateTime::createFromFormat('[% date_format %]', $value) : null; \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/model-mutator-multiple-answers.stub b/resources/laravel-code-generator/templates/default/model-mutator-multiple-answers.stub deleted file mode 100644 index 0da4880..0000000 --- a/resources/laravel-code-generator/templates/default/model-mutator-multiple-answers.stub +++ /dev/null @@ -1 +0,0 @@ -$this->attributes['[% field_name %]'] = json_encode($value); \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/model-mutator.stub b/resources/laravel-code-generator/templates/default/model-mutator.stub deleted file mode 100644 index fc8eae0..0000000 --- a/resources/laravel-code-generator/templates/default/model-mutator.stub +++ /dev/null @@ -1,10 +0,0 @@ - /** - * Set the [% field_name %]. - * - * @param string $value - * @return void - */ - public function set[% field_name_cap %]Attribute($value) - { - [% content %] - } diff --git a/resources/laravel-code-generator/templates/default/model-primary-key.stub b/resources/laravel-code-generator/templates/default/model-primary-key.stub deleted file mode 100644 index 925b8ea..0000000 --- a/resources/laravel-code-generator/templates/default/model-primary-key.stub +++ /dev/null @@ -1,6 +0,0 @@ - /** - * The database primary key value. - * - * @var string - */ - protected $primaryKey = '[% primary_key %]'; \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/model-relation.stub b/resources/laravel-code-generator/templates/default/model-relation.stub deleted file mode 100644 index 0ce8050..0000000 --- a/resources/laravel-code-generator/templates/default/model-relation.stub +++ /dev/null @@ -1,9 +0,0 @@ - /** - * Get the [% relation_name %] for this model. - * - * @return [% relation_return_type %] - */ - public function [% relation_name %]() - { - return $this->[% relation_type %]([% relation_params %]); - } diff --git a/resources/laravel-code-generator/templates/default/model-timestamps.stub b/resources/laravel-code-generator/templates/default/model-timestamps.stub deleted file mode 100644 index ca00793..0000000 --- a/resources/laravel-code-generator/templates/default/model-timestamps.stub +++ /dev/null @@ -1,6 +0,0 @@ - /** - * Indicates if the model should be timestamped. - * - * @var bool - */ - public $timestamps = false; \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/model.stub b/resources/laravel-code-generator/templates/default/model.stub deleted file mode 100644 index a80befd..0000000 --- a/resources/laravel-code-generator/templates/default/model.stub +++ /dev/null @@ -1,44 +0,0 @@ -hasPages()) - -@endif diff --git a/resources/laravel-code-generator/templates/default/routes-8.stub b/resources/laravel-code-generator/templates/default/routes-8.stub deleted file mode 100644 index fb8be75..0000000 --- a/resources/laravel-code-generator/templates/default/routes-8.stub +++ /dev/null @@ -1,14 +0,0 @@ - Route::get('/', [[% controller_name %]::class, 'index']) - ->name('[% index_route_name %]'); - Route::get('/create', [[% controller_name %]::class, 'create']) - ->name('[% create_route_name %]'); - Route::get('/show/{[% model_name_singular_variable %]}',[[% controller_name %]::class, 'show']) - ->name('[% show_route_name %]')[% route_id_clause %]; - Route::get('/{[% model_name_singular_variable %]}/edit',[[% controller_name %]::class, 'edit']) - ->name('[% edit_route_name %]')[% route_id_clause %]; - Route::post('/', [[% controller_name %]::class, 'store']) - ->name('[% store_route_name %]'); - Route::put('[% model_name_snake %]/{[% model_name_singular_variable %]}', [[% controller_name %]::class, 'update']) - ->name('[% update_route_name %]')[% route_id_clause %]; - Route::delete('/[% model_name_snake %]/{[% model_name_singular_variable %]}',[[% controller_name %]::class, 'destroy']) - ->name('[% destroy_route_name %]')[% route_id_clause %]; \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/routes-group.stub b/resources/laravel-code-generator/templates/default/routes-group.stub deleted file mode 100644 index 23a1f20..0000000 --- a/resources/laravel-code-generator/templates/default/routes-group.stub +++ /dev/null @@ -1,6 +0,0 @@ - -Route::group([ - [% prefix %] -], function () { -[% routes %] -}); diff --git a/resources/laravel-code-generator/templates/default/routes.stub b/resources/laravel-code-generator/templates/default/routes.stub deleted file mode 100644 index 615d786..0000000 --- a/resources/laravel-code-generator/templates/default/routes.stub +++ /dev/null @@ -1,14 +0,0 @@ - Route::get('/', '[% controller_name %]@index') - ->name('[% index_route_name %]'); - Route::get('/create','[% controller_name %]@create') - ->name('[% create_route_name %]'); - Route::get('/show/{[% model_name_singular_variable %]}','[% controller_name %]@show') - ->name('[% show_route_name %]')[% route_id_clause %]; - Route::get('/{[% model_name_singular_variable %]}/edit','[% controller_name %]@edit') - ->name('[% edit_route_name %]')[% route_id_clause %]; - Route::post('/', '[% controller_name %]@store') - ->name('[% store_route_name %]'); - Route::put('[% model_name_snake %]/{[% model_name_singular_variable %]}', '[% controller_name %]@update') - ->name('[% update_route_name %]')[% route_id_clause %]; - Route::delete('/[% model_name_snake %]/{[% model_name_singular_variable %]}','[% controller_name %]@destroy') - ->name('[% destroy_route_name %]')[% route_id_clause %]; \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/show.blade.stub b/resources/laravel-code-generator/templates/default/show.blade.stub deleted file mode 100644 index 047f2af..0000000 --- a/resources/laravel-code-generator/templates/default/show.blade.stub +++ /dev/null @@ -1,42 +0,0 @@ -@extends('[% layout_name %]') - -@section('content') - -
- -
-

{{ isset([% model_header %]) ? [% model_header %] : '[% model_name_title %]' }}

-
-
- - {{ csrf_field() }} - - - - - - - - - - - - - - - -
-
-
- -
-
-[% table_rows %] -
- -
-
- -@endsection \ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/show.row.blade.stub b/resources/laravel-code-generator/templates/default/show.row.blade.stub deleted file mode 100644 index 1d714e6..0000000 --- a/resources/laravel-code-generator/templates/default/show.row.blade.stub +++ /dev/null @@ -1,2 +0,0 @@ -
[% field_title %]
-
{{ [% field_value %] }}
\ No newline at end of file diff --git a/resources/laravel-code-generator/templates/default/view-model.stub b/resources/laravel-code-generator/templates/default/view-model.stub deleted file mode 100644 index d861db4..0000000 --- a/resources/laravel-code-generator/templates/default/view-model.stub +++ /dev/null @@ -1,30 +0,0 @@ - 'Data']) - -@section('content') - -@include('layouts.partials/page-title', ['title' => 'Data', 'subtitle' => 'Tata Ruang']) - - -
-
-
-
- Back -
-
-
- @csrf - @include('spatial-plannings.form') - -
-
-
-
-
- -@endsection - -@section('scripts') -@vite(['resources/js/spatial-plannings/create.js']) -@endsection diff --git a/resources/views/spatial-plannings/form.blade.php b/resources/views/spatial-plannings/form.blade.php deleted file mode 100644 index 18c78ea..0000000 --- a/resources/views/spatial-plannings/form.blade.php +++ /dev/null @@ -1,28 +0,0 @@ -
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
\ No newline at end of file diff --git a/resources/views/spatial-plannings/index.blade.php b/resources/views/spatial-plannings/index.blade.php deleted file mode 100644 index 3aa2fcb..0000000 --- a/resources/views/spatial-plannings/index.blade.php +++ /dev/null @@ -1,31 +0,0 @@ -@extends('layouts.vertical', ['subtitle' => 'Data']) - -@section('css') -@vite(['node_modules/gridjs/dist/theme/mermaid.min.css']) -@endsection - -@section('content') - -@include('layouts.partials/page-title', ['title' => 'Data', 'subtitle' => 'Tata Ruang']) - - - -
-
-
-
-
- Create - Upload -
-
-
-
-
-
- -@endsection - -@section('scripts') -@vite(['resources/js/spatial-plannings/index.js']) -@endsection \ No newline at end of file diff --git a/resources/views/spatial-plannings/update.blade.php b/resources/views/spatial-plannings/update.blade.php deleted file mode 100644 index 8b198f4..0000000 --- a/resources/views/spatial-plannings/update.blade.php +++ /dev/null @@ -1,33 +0,0 @@ -@extends('layouts.vertical', ['subtitle' => 'Data']) - -@section('content') - -@include('layouts.partials/page-title', ['title' => 'Data', 'subtitle' => 'Tata Ruang']) - - -
-
-
-
- Back -
-
-
- @csrf - @method('put') - @include('spatial-plannings.form') - -
-
-
-
-
- -@endsection - -@section('scripts') -@vite(['resources/js/spatial-plannings/update.js']) -@endsection diff --git a/resources/views/spatial-plannings/upload.blade.php b/resources/views/spatial-plannings/upload.blade.php deleted file mode 100644 index a70e86d..0000000 --- a/resources/views/spatial-plannings/upload.blade.php +++ /dev/null @@ -1,80 +0,0 @@ -@extends('layouts.vertical', ['subtitle' => 'Data']) - -@section('content') - -@include('layouts.partials/page-title', ['title' => 'Data', 'subtitle' => 'Tata Ruang']) - - -
-
-
-
-
Upload Data
-

- Please upload a file with the extension .xls or .xlsx with a maximum size of 10 MB. -
- For .xls and .xlsx files, ensure that the data is contained within a single sheet with the following columns: - No, Nama, KBLI, Kegiatan, Luas, Lokasi, Nomor, Tanggal. -

-
- -
- -
- -
-
-
- -
-
-
- -

Drop files here or click to upload.

-
-
- -
    -
  • - -
    -
    -
    -
    - -
    -
    -
    -
    -
      -
    -

    - -
    -
    -
    - -
    -
    -
    -
  • -
- -
-
- -
-
-
-
-
- -@endsection - -@section('scripts') -@vite(['resources/js/spatial-plannings/upload.js']) -@endsection \ No newline at end of file diff --git a/routes/api.php b/routes/api.php index 82fe8ad..b7d90f8 100644 --- a/routes/api.php +++ b/routes/api.php @@ -101,14 +101,6 @@ Route::group(['middleware' => 'auth:sanctum'], function (){ Route::apiResource('api-business-industries', BusinessOrIndustriesController::class); Route::post('api-business-industries/upload', [BusinessOrIndustriesController::class, 'upload'])->name('business-industries.upload'); - Route::controller(SpatialPlanningsController::class)->group( function (){ - Route::get('/spatial-plannings', 'index')->name('api.spatial-plannings'); - Route::post('/spatial-plannings', 'store')->name('api.spatial-plannings.store'); - Route::put('/spatial-plannings/{id}', 'update')->name('api.spatial-plannings.update'); - Route::delete('/spatial-plannings/{id}', 'destroy')->name('api.spatial-plannings.destroy'); - Route::post('/spatial-plannings/upload', 'upload')->name('api.spatial-plannings.upload'); - }); - Route::controller(CustomersController::class)->group( function (){ Route::get('/customers', 'index')->name('api.customers'); Route::post('/customers', 'store')->name('api.customers.store'); diff --git a/routes/web.php b/routes/web.php index 4fc0e97..cf98a4c 100755 --- a/routes/web.php +++ b/routes/web.php @@ -94,13 +94,6 @@ Route::group(['middleware' => 'auth'], function(){ Route::resource('/business-industries',BusinessOrIndustriesController::class); - Route::controller(SpatialPlanningsController::class)->group( function (){ - Route::get('/spatial-plannings', 'index')->name('spatial-plannings'); - Route::get('/spatial-plannings/create', 'create')->name('spatial-plannings.create'); - Route::get('/spatial-plannings/{spatial_planning_id}/edit', 'edit')->name('spatial-plannings.edit'); - Route::get('/spatial-plannings/upload', 'upload')->name('spatial-plannings.upload'); - }); - Route::controller(CustomersController::class)->group( function (){ Route::get('/customers', 'index')->name('customers'); Route::get('/customers/create', 'create')->name('customers.create'); diff --git a/vite.config.js b/vite.config.js index 91ba97a..d660a40 100755 --- a/vite.config.js +++ b/vite.config.js @@ -90,10 +90,9 @@ export default defineConfig({ "resources/js/data/tourisms/form-upload.js", "resources/js/report/tourisms/index.js", // spatial-plannings - "resources/js/spatial-plannings/index.js", - "resources/js/spatial-plannings/create.js", - "resources/js/spatial-plannings/update.js", - "resources/js/spatial-plannings/upload.js", + "resources/js/data/spatialPlannings/data-spatialPlannings.js", + "resources/js/data/spatialPlannings/form-create-update.js", + "resources/js/data/spatialPlannings/form-upload.js", // customers "resources/js/customers/upload.js", "resources/js/customers/index.js",