Skip to content

Commit

Permalink
redirect to show page after create/update
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici committed Apr 2, 2020
1 parent 9af71dd commit c5cfc42
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/Http/Controllers/Purchases/Bills.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public function store(Request $request)
$response = $this->ajaxDispatch(new CreateBill($request));

if ($response['success']) {
$response['redirect'] = route('bills.index');
$response['redirect'] = route('bills.show', $response['data']->id);

$message = trans('messages.success.added', ['type' => trans_choice('general.bills', 1)]);

Expand Down Expand Up @@ -221,7 +221,7 @@ public function update(Bill $bill, Request $request)
$response = $this->ajaxDispatch(new UpdateBill($bill, $request));

if ($response['success']) {
$response['redirect'] = route('bills.index');
$response['redirect'] = route('bills.show', $response['data']->id);

$message = trans('messages.success.updated', ['type' => trans_choice('general.bills', 1)]);

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Sales/Invoices.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public function update(Invoice $invoice, Request $request)
$response = $this->ajaxDispatch(new UpdateInvoice($invoice, $request));

if ($response['success']) {
$response['redirect'] = route('invoices.index');
$response['redirect'] = route('invoices.show', $response['data']->id);

$message = trans('messages.success.updated', ['type' => trans_choice('general.invoices', 1)]);

Expand Down

0 comments on commit c5cfc42

Please sign in to comment.