diff --git a/backend/app/Http/Controllers/KategoriController.php b/backend/app/Http/Controllers/KategoriController.php index 9620726..b89d87c 100644 --- a/backend/app/Http/Controllers/KategoriController.php +++ b/backend/app/Http/Controllers/KategoriController.php @@ -24,11 +24,11 @@ class KategoriController extends Controller // Simpan kategori baru public function store(Request $request) { - $request->validate([ - 'nama' => 'required|string|max:255', - 'deskripsi' => 'nullable|string', - 'foto' => 'nullable|image|mimes:jpg,jpeg,png|max:2048' - ]); + $request->validate([ + 'nama' => 'required|string|max:255', + 'deskripsi' => 'nullable|string', + 'foto' => 'nullable|image|mimes:jpeg,png,jpg,gif|max:5120' // 5MB = 5120KB + ]); $data = $request->all(); if ($request->hasFile('foto')) { @@ -51,7 +51,7 @@ class KategoriController extends Controller 'foto' => 'nullable|image|mimes:jpg,jpeg,png|max:2048' ]); - $data = $request->all(); + $data = $request->all(); if ($request->hasFile('foto')) { if ($kategori->foto) { Storage::disk('public')->delete($kategori->foto); diff --git a/backend/resources/views/admin/dashboard.blade.php b/backend/resources/views/admin/dashboard.blade.php index 8bb0319..acd2d37 100644 --- a/backend/resources/views/admin/dashboard.blade.php +++ b/backend/resources/views/admin/dashboard.blade.php @@ -3,111 +3,52 @@ @section('title', 'Halaman Dasbor') @section('content') -