Skip to content

Commit

Permalink
catch-all forum routes, and redirect to discord page
Browse files Browse the repository at this point in the history
also forced redirect on all forum routes, to ensure React doesn't just route to them
  • Loading branch information
Mateusz committed Apr 14, 2021
1 parent bc4490c commit ead17d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/Resources/App/Forum.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ public function operations()
{
return [
'overview' => React::create()
->forceRedirect(true)
->component('Forum.Overview')
->path('piratsnak')
->title('Piratsnak'),
'topic' => React::create()
->forceRedirect(true)
->component('Forum.Topic')
->path('piratsnak/emner/{topic}/{topic_slug}'),
'thread' => React::create()
->forceRedirect(true)
->component('Forum.Thread')
->path('piratsnak/snakke/{thread}'),
'message' => RedirectToMessage::create()->path('piratsnak/snakke/{thread}/besked/{message}')
Expand Down
4 changes: 4 additions & 0 deletions routes/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@
|
*/

Route::get('/piratsnak/{any?}', function () {
return redirect(route('app.pages.posts', ['path' => 'piratsnak']));
})->where('any', '.*');

ResourceRepository::routes('app', ['guard' => 'web']);

0 comments on commit ead17d9

Please sign in to comment.