mirror of
https://github.com/flarum/framework.git
synced 2025-02-06 19:53:59 +08:00
Shorten registration of routes
This commit is contained in:
parent
c923d23f32
commit
4cd503746f
|
@ -41,11 +41,9 @@ class AdminServiceProvider extends AbstractServiceProvider
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->app->singleton('flarum.admin.routes', function () {
|
$this->app->singleton('flarum.admin.routes', function () {
|
||||||
return new RouteCollection;
|
$routes = new RouteCollection;
|
||||||
});
|
|
||||||
|
|
||||||
$this->app->afterResolving('flarum.admin.routes', function (RouteCollection $routes) {
|
|
||||||
$this->populateRoutes($routes);
|
$this->populateRoutes($routes);
|
||||||
|
return $routes;
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->app->singleton('flarum.admin.middleware', function (Application $app) {
|
$this->app->singleton('flarum.admin.middleware', function (Application $app) {
|
||||||
|
|
|
@ -40,11 +40,9 @@ class ApiServiceProvider extends AbstractServiceProvider
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->app->singleton('flarum.api.routes', function () {
|
$this->app->singleton('flarum.api.routes', function () {
|
||||||
return new RouteCollection;
|
$routes = new RouteCollection;
|
||||||
});
|
|
||||||
|
|
||||||
$this->app->afterResolving('flarum.api.routes', function (RouteCollection $routes) {
|
|
||||||
$this->populateRoutes($routes);
|
$this->populateRoutes($routes);
|
||||||
|
return $routes;
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->app->singleton('flarum.api.middleware', function (Application $app) {
|
$this->app->singleton('flarum.api.middleware', function (Application $app) {
|
||||||
|
|
|
@ -46,11 +46,9 @@ class ForumServiceProvider extends AbstractServiceProvider
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->app->singleton('flarum.forum.routes', function () {
|
$this->app->singleton('flarum.forum.routes', function () {
|
||||||
return new RouteCollection;
|
$routes = new RouteCollection;
|
||||||
});
|
|
||||||
|
|
||||||
$this->app->afterResolving('flarum.forum.routes', function (RouteCollection $routes) {
|
|
||||||
$this->populateRoutes($routes);
|
$this->populateRoutes($routes);
|
||||||
|
return $routes;
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->app->singleton('flarum.forum.middleware', function (Application $app) {
|
$this->app->singleton('flarum.forum.middleware', function (Application $app) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user