refactor: adopt new helpers in laravel 9

This commit is contained in:
HDVinnie
2022-03-06 17:20:05 -05:00
parent 44e5681671
commit 594b7864d9
89 changed files with 465 additions and 470 deletions
+3 -3
View File
@@ -52,7 +52,7 @@ class PollController extends Controller
$userHasVoted = $poll->voters->where('user_id', '=', $user->id)->isNotEmpty();
if ($userHasVoted) {
return \redirect()->route('poll_results', ['id' => $poll->id])
return \to_route('poll_results', ['id' => $poll->id])
->withInfo(\trans('poll.already-voted-result'));
}
@@ -70,7 +70,7 @@ class PollController extends Controller
->where('poll_id', '=', $poll->id)
->exists();
if ($voted) {
return \redirect()->route('poll_results', ['id' => $poll->id])
return \to_route('poll_results', ['id' => $poll->id])
->withErrors(\trans('poll.already-voted-error'));
}
@@ -92,7 +92,7 @@ class PollController extends Controller
\sprintf('[url=%s]%s[/url] has voted on poll [url=%s]%s[/url]', $profileUrl, $user->username, $pollUrl, $poll->title)
);
return \redirect()->route('poll_results', ['id' => $poll->id])
return \to_route('poll_results', ['id' => $poll->id])
->withSuccess(\trans('poll.vote-counted'));
}