mirror of
https://github.com/flarum/framework.git
synced 2025-02-01 07:54:00 +08:00
Frontends: Populate default routes only when they are resolved
This commit is contained in:
parent
ba594de13a
commit
1080d25561
|
@ -44,6 +44,10 @@ class AdminServiceProvider extends AbstractServiceProvider
|
|||
return new RouteCollection;
|
||||
});
|
||||
|
||||
$this->app->afterResolving('flarum.admin.routes', function (RouteCollection $routes) {
|
||||
$this->populateRoutes($routes);
|
||||
});
|
||||
|
||||
$this->app->singleton('flarum.admin.middleware', function (Application $app) {
|
||||
$pipe = new MiddlewarePipe;
|
||||
|
||||
|
@ -103,8 +107,6 @@ class AdminServiceProvider extends AbstractServiceProvider
|
|||
*/
|
||||
public function boot()
|
||||
{
|
||||
$this->populateRoutes($this->app->make('flarum.admin.routes'));
|
||||
|
||||
$this->loadViewsFrom(__DIR__.'/../../views', 'flarum.admin');
|
||||
|
||||
$events = $this->app->make('events');
|
||||
|
|
|
@ -49,6 +49,10 @@ class ForumServiceProvider extends AbstractServiceProvider
|
|||
return new RouteCollection;
|
||||
});
|
||||
|
||||
$this->app->afterResolving('flarum.forum.routes', function (RouteCollection $routes) {
|
||||
$this->populateRoutes($routes);
|
||||
});
|
||||
|
||||
$this->app->singleton('flarum.forum.middleware', function (Application $app) {
|
||||
$pipe = new MiddlewarePipe;
|
||||
|
||||
|
@ -110,8 +114,6 @@ class ForumServiceProvider extends AbstractServiceProvider
|
|||
*/
|
||||
public function boot()
|
||||
{
|
||||
$this->populateRoutes($this->app->make('flarum.forum.routes'));
|
||||
|
||||
$this->loadViewsFrom(__DIR__.'/../../views', 'flarum.forum');
|
||||
|
||||
$this->app->make('view')->share([
|
||||
|
|
Loading…
Reference in New Issue
Block a user