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