From 623a0938d4a11ad625a22177f1aad9a01435017b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Burak=20=C3=87ak=C4=B1rel?= Date: Tue, 21 Jan 2020 19:51:14 +0300 Subject: [PATCH] Redirect to bill page after adding a payment to a bill --- app/Http/Controllers/Modals/BillTransactions.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Http/Controllers/Modals/BillTransactions.php b/app/Http/Controllers/Modals/BillTransactions.php index e227c49b9..0ad12c126 100644 --- a/app/Http/Controllers/Modals/BillTransactions.php +++ b/app/Http/Controllers/Modals/BillTransactions.php @@ -87,11 +87,14 @@ class BillTransactions extends Controller $message = trans('messages.success.added', ['type' => trans_choice('general.payments', 1)]); + flash($message)->success(); + $response = [ 'success' => true, 'error' => false, 'message' => $message, 'data' => $transaction, + 'redirect' => route('bills.show', $bill->id), ]; } catch(\Exception $e) { $response = [ @@ -99,6 +102,7 @@ class BillTransactions extends Controller 'error' => true, 'message' => $e->getMessage(), 'data' => 'null', + 'redirect' => null, ]; }