From 319f3ca1ffc79bed40c79d5430975ecd09bbf7ee Mon Sep 17 00:00:00 2001 From: daffarahman11 Date: Tue, 25 Mar 2025 09:02:02 +0700 Subject: [PATCH] Update fitur show edit dan blade curanmor --- app/Http/Controllers/CuranmorController.php | 17 ++++- .../Admin/dashboardEditCuranmor.blade.php | 63 +++++++++++++++++++ .../Admin/dashboardListCuranmor.blade.php | 24 +++---- 3 files changed, 90 insertions(+), 14 deletions(-) create mode 100644 resources/views/Admin/dashboardEditCuranmor.blade.php diff --git a/app/Http/Controllers/CuranmorController.php b/app/Http/Controllers/CuranmorController.php index f197fd5..e330bb3 100644 --- a/app/Http/Controllers/CuranmorController.php +++ b/app/Http/Controllers/CuranmorController.php @@ -56,9 +56,20 @@ public function show(Curanmor $curanmor) /** * Show the form for editing the specified resource. */ - public function edit(Curanmor $curanmor) + public function edit($curanmor) { - // + try { + + $edit = Curanmor::find($curanmor); + + return view('admin.dashboardEditCuranmor', [ + 'curanmor' => $edit, + 'kecamatans' => Kecamatan::all(), + 'klasters' => Klaster::all(), + ]); + } catch (\Exception $e) { + abort(404); + } } /** @@ -72,7 +83,7 @@ public function update(Request $request, Curanmor $curanmor) /** * Remove the specified resource from storage. */ - public function destroy(Curanmor $curanmor) + public function destroy($curanmor) { try{ $hapus = Curanmor::find($curanmor); diff --git a/resources/views/Admin/dashboardEditCuranmor.blade.php b/resources/views/Admin/dashboardEditCuranmor.blade.php new file mode 100644 index 0000000..fa73cc2 --- /dev/null +++ b/resources/views/Admin/dashboardEditCuranmor.blade.php @@ -0,0 +1,63 @@ + +
+
+
+
+
+
+
+

Ubah Data Kasus CURANMOR Pada Kecamatan + {{ $curanmor->punyaKecamatanCuranmor->nama_kecamatan}}

+
+
+
+
+ @method('put') + @csrf +
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+ + +
+
+
+
+
+ +
+
+
+ \ No newline at end of file diff --git a/resources/views/Admin/dashboardListCuranmor.blade.php b/resources/views/Admin/dashboardListCuranmor.blade.php index d0c3719..de55645 100644 --- a/resources/views/Admin/dashboardListCuranmor.blade.php +++ b/resources/views/Admin/dashboardListCuranmor.blade.php @@ -9,18 +9,18 @@

Sales enables you to effectively control sales KPIs and monitor them in one central
place while helping teams to reach sales goals.

- Tambah Data Curanmor + Tambah Kasus Curanmor @if (session()->has('succes')) - @endif - @if (session()->has('error')) + @endif + @if (session()->has('error')) - @endif + @endif
@@ -35,7 +35,7 @@ id Nama Kecamatan - Jumlah Kasus Curas + Jumlah Kasus Curanmor Klaster Action @@ -50,17 +50,19 @@
{{ $curanmor->id }} - {{ $curanmor->punyaKecamatanCuranmor->nama_kecamatan }} + {{ $curanmor->punyaKecamatanCuranmor->nama_kecamatan}} {{ $curanmor->jumlah_curanmor }} {{ $curanmor->punyaKlasterCuranmor->nama_klaster }}
- - + href="/curanmor/{{ $curanmor->id }}/edit"> +
+ @method('delete') + @csrf + + +