mirror of
https://github.com/flarum/core.git
synced 2025-07-20 08:11:27 +02:00
Shorten registration of routes
This commit is contained in:
@@ -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) {
|
||||||
|
Reference in New Issue
Block a user