mirror of
https://github.com/flarum/core.git
synced 2025-08-18 22:31:32 +02:00
Implement default route config setting
This commit is contained in:
@@ -31,7 +31,8 @@ class ForumSerializer extends Serializer
|
||||
'themePrimaryColor' => Core::config('theme_primary_color'),
|
||||
'canView' => $forum->can($this->actor, 'view'),
|
||||
'canStartDiscussion' => $forum->can($this->actor, 'startDiscussion'),
|
||||
'allowSignUp' => (bool) Core::config('allow_sign_up')
|
||||
'allowSignUp' => (bool) Core::config('allow_sign_up'),
|
||||
'defaultRoute' => Core::config('default_route')
|
||||
];
|
||||
|
||||
if ($this->actor->isAdmin()) {
|
||||
|
@@ -53,7 +53,7 @@ class ForumServiceProvider extends ServiceProvider
|
||||
$this->app->instance('flarum.forum.routes', $routes = new RouteCollection);
|
||||
|
||||
$routes->get(
|
||||
'/',
|
||||
'/all',
|
||||
'flarum.forum.index',
|
||||
$this->action('Flarum\Forum\Actions\IndexAction')
|
||||
);
|
||||
@@ -113,6 +113,14 @@ class ForumServiceProvider extends ServiceProvider
|
||||
);
|
||||
|
||||
event(new RegisterForumRoutes($routes));
|
||||
|
||||
$settings = $this->app->make('Flarum\Core\Settings\SettingsRepository');
|
||||
|
||||
$routes->get(
|
||||
'/',
|
||||
'flarum.forum.default',
|
||||
$routes->getRouteData()[0]['GET'][$settings->get('default_route')]
|
||||
);
|
||||
}
|
||||
|
||||
protected function action($class)
|
||||
|
Reference in New Issue
Block a user