From 07aac28e8a068c9eea80b53e4d967201e1e50fe1 Mon Sep 17 00:00:00 2001 From: ariefabbauftech-ai Date: Tue, 9 Sep 2025 13:21:03 +0700 Subject: [PATCH] [Contoller Templat Harga] --- backend/app/Http/Controllers/TemplateController.php | 4 +++- .../migrations/2025_09_08_085234_create_pelanggans_table.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/app/Http/Controllers/TemplateController.php b/backend/app/Http/Controllers/TemplateController.php index 78cf437..577947a 100644 --- a/backend/app/Http/Controllers/TemplateController.php +++ b/backend/app/Http/Controllers/TemplateController.php @@ -26,6 +26,7 @@ class TemplateController extends Controller 'kategori_id' => 'required|exists:kategoris,id', 'fitur_id' => 'required|exists:fiturs,id', 'foto' => 'nullable|image|mimes:jpg,jpeg,png,gif|max:5120', + 'harga' => 'required|numeric', ]); if ($request->hasFile('foto')) { @@ -43,6 +44,7 @@ class TemplateController extends Controller 'kategori_id' => 'required|exists:kategoris,id', 'fitur_id' => 'required|exists:fiturs,id', 'foto' => 'nullable|image|mimes:jpg,jpeg,png,gif|max:5120', + 'harga' => 'required|numeric', ]); if ($request->hasFile('foto')) { @@ -75,6 +77,6 @@ class TemplateController extends Controller $kategoris = Kategori::all(); $fiturs = Fitur::all(); - return view('admin.templates.index', compact('templates', 'kategoris', 'fiturs', 'kategori')); + return view('admin.templates.index', compact('templates', 'kategoris', 'fiturs', 'kategori', 'harga')); } } diff --git a/backend/database/migrations/2025_09_08_085234_create_pelanggans_table.php b/backend/database/migrations/2025_09_08_085234_create_pelanggans_table.php index cb826b2..accd3c0 100644 --- a/backend/database/migrations/2025_09_08_085234_create_pelanggans_table.php +++ b/backend/database/migrations/2025_09_08_085234_create_pelanggans_table.php @@ -11,7 +11,7 @@ return new class extends Migration { $table->id(); $table->string('nama_pemesan'); $table->string('nama_template'); - $table->string('kategori'); // pernikahan / ulang_tahun / khitan + $table->string('kategori'); $table->string('email'); $table->string('no_tlpn'); $table->decimal('harga', 15, 2)->nullable();