diff --git a/app/Http/Controllers/PermohonanController.php b/app/Http/Controllers/PermohonanController.php index b6a43f6..6bd6bfb 100644 --- a/app/Http/Controllers/PermohonanController.php +++ b/app/Http/Controllers/PermohonanController.php @@ -108,7 +108,6 @@ public function update(PermohonanRequest $request, $id) { $validate = $request->validated(); - if ($validate) { try { // Update in database @@ -116,6 +115,7 @@ if ($permohonan->status == 'revisi') { $validate['status'] = 'order'; } + $permohonan->update($validate); return redirect() ->route('permohonan.index')->with('success', 'Permohonan updated successfully'); diff --git a/app/Http/Requests/PermohonanRequest.php b/app/Http/Requests/PermohonanRequest.php index 9dddc42..3f2f252 100644 --- a/app/Http/Requests/PermohonanRequest.php +++ b/app/Http/Requests/PermohonanRequest.php @@ -17,7 +17,7 @@ 'nomor_registrasi' => 'nullable|string|max:10', 'tanggal_permohonan' => 'nullable|date', 'user_id' => 'nullable|exists:users,id', - 'branch_id' => 'required|exists:branches,id', + 'branch_id' => 'nullable|exists:branches,id', 'tujuan_penilaian_id' => 'required|exists:tujuan_penilaian,id', 'debiture_id' => 'required|exists:debitures,id', 'status' => 'nullable|string', diff --git a/resources/views/permohonan/form.blade.php b/resources/views/permohonan/form.blade.php index 223194a..1336330 100644 --- a/resources/views/permohonan/form.blade.php +++ b/resources/views/permohonan/form.blade.php @@ -34,6 +34,7 @@