extracts the dashboard routes

This commit is contained in:
Connor S. Parks
2016-08-20 12:23:30 +01:00
parent dbb87782e3
commit b3b3de3a90
13 changed files with 631 additions and 244 deletions

View File

@@ -68,8 +68,14 @@ class RouteServiceProvider extends ServiceProvider
public function map(Router $router)
{
$router->group(['namespace' => $this->namespace], function (Router $router) {
foreach (glob(app_path('Http//Routes').'/*.php') as $file) {
$this->app->make('CachetHQ\\Cachet\\Http\\Routes\\'.basename($file, '.php'))->map($router);
$path = app_path('Http/Routes');
foreach (glob("{$path}/*{,/*}.php", GLOB_BRACE) as $file) {
$class = substr($file, strlen($path));
$class = str_replace('/', '\\', $class);
$class = substr($class, 0, -4);
$this->app->make("CachetHQ\\Cachet\\Http\\Routes${class}")->map($router);
}
});
}