diff --git a/app/Http/Controllers/InvoiceController.php b/app/Http/Controllers/InvoiceController.php index acd4e542..394ccf1a 100644 --- a/app/Http/Controllers/InvoiceController.php +++ b/app/Http/Controllers/InvoiceController.php @@ -315,7 +315,8 @@ class InvoiceController extends Controller // Change Status to 7 if approve // Add email event here if ($validatedData['status'] === 'approve') { - $booking = Booking::find($id); + + $booking = Booking::findOrFail($id); $booking->status = 7; $booking->admin_status = 7; $booking->save(); @@ -323,6 +324,8 @@ class InvoiceController extends Controller if(!$booking) { return response()->json(['message' => 'Unable to Complete Booking. Please Approve Again'], 500); } + + } // Response