(Update) Replace Usage Of redirect()->back() 🚀

- replacing usages of `redirect()->back()` in favor of defining the named route.
This commit is contained in:
HDVinnie
2019-03-08 19:53:51 -05:00
parent 4acf512bae
commit b9968aef6b
7 changed files with 15 additions and 14 deletions
+2 -2
View File
@@ -151,7 +151,7 @@ class InviteController extends Controller
abort_unless($invite->user_id === $user->id, 403);
if ($invite->accepted_by !== null) {
return redirect()->back()
return redirect()->route('user_invites', ['slug' => $user->slug, 'id' => $user->id])
->with($this->toastr->error('The invite you are trying to resend has already been used.', 'Whoops!', ['options']));
}
@@ -160,7 +160,7 @@ class InviteController extends Controller
// Activity Log
\LogActivity::addToLog("Member {$user->username} has resent invite to {$invite->email} .");
return redirect()->back()
return redirect()->route('user_invites', ['slug' => $user->slug, 'id' => $user->id])
->with($this->toastr->success('Invite was resent successfully!', 'Yay!', ['options']));
}