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
@@ -56,7 +56,7 @@ class PostController extends Controller
// The user has the right to create a post here?
if (! $category->getPermission()->reply_topic || ($topic->state == 'close' && ! $request->user()->group->is_modo)) {
return \redirect()->route('forums.index')
return \to_route('forums.index')
->withErrors(\trans('forum.reply-topic-error'));
}
@@ -72,7 +72,7 @@ class PostController extends Controller
]);
if ($v->fails()) {
return \redirect()->route('forum_topic', ['id' => $topic->id])
return \to_route('forum_topic', ['id' => $topic->id])
->withErrors($v->errors());
}
@@ -211,7 +211,7 @@ class PostController extends Controller
\abort_unless($user->group->is_modo || $user->id === $post->user_id, 403);
$post->delete();
return \redirect()->route('forum_topic', ['id' => $post->topic->id])
return \to_route('forum_topic', ['id' => $post->topic->id])
->withSuccess(\trans('forum.delete-post-success'));
}
}