1
0
mirror of https://github.com/flarum/core.git synced 2025-08-05 07:57:46 +02:00

Shorten registration of routes

This commit is contained in:
Franz Liedke
2018-12-19 21:57:59 +01:00
parent 1080d25561
commit e4514d8413
3 changed files with 6 additions and 12 deletions

View File

@@ -40,11 +40,9 @@ class ApiServiceProvider extends AbstractServiceProvider
});
$this->app->singleton('flarum.api.routes', function () {
return new RouteCollection;
});
$this->app->afterResolving('flarum.api.routes', function (RouteCollection $routes) {
$routes = new RouteCollection;
$this->populateRoutes($routes);
return $routes;
});
$this->app->singleton('flarum.api.middleware', function (Application $app) {