mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-30 23:42:49 -05:00
refactor: adopt new helpers in laravel 9
This commit is contained in:
@@ -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'));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user