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