From 9f81d4df6ee6f7a4a283754fb971b8b605ffed47 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Sat, 27 Sep 2014 20:35:07 -0500 Subject: [PATCH] Simplify things. --- app/Providers/RouteServiceProvider.php | 12 ++-- bootstrap/paths.php | 85 ++++++++++++++++---------- config/namespaces.php | 39 ------------ 3 files changed, 57 insertions(+), 79 deletions(-) delete mode 100644 config/namespaces.php diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index b0e9c432..e67b1c57 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -17,9 +17,7 @@ class RouteServiceProvider extends ServiceProvider { */ public function before(Router $router, UrlGenerator $url) { - $url->setRootControllerNamespace( - trim(config('namespaces.controllers'), '\\') - ); + $url->setRootControllerNamespace('App\Http\Controllers'); } /** @@ -29,12 +27,12 @@ class RouteServiceProvider extends ServiceProvider { */ public function map() { + // Once the application has booted, we will include the default routes + // file. This "namespace" helper will load the routes file within a + // route group which automatically sets the controller namespace. $this->app->booted(function() { - // Once the application has booted, we will include the default routes - // file. This "namespace" helper will load the routes file within a - // route group which automatically sets the controller namespace. - $this->namespaced(function(Router $router) + $this->namespaced('App\Http\Controllers', function(Router $router) { require app_path().'/Http/routes.php'; }); diff --git a/bootstrap/paths.php b/bootstrap/paths.php index eafe0e62..9d9d14bc 100644 --- a/bootstrap/paths.php +++ b/bootstrap/paths.php @@ -15,19 +15,6 @@ return [ 'app' => __DIR__.'/../app', - /* - |-------------------------------------------------------------------------- - | Public Path - |-------------------------------------------------------------------------- - | - | The public path contains the assets for your web application, such as - | your JavaScript and CSS files, and also contains the primary entry - | point for web requests into these applications from the outside. - | - */ - - 'public' => __DIR__.'/../public', - /* |-------------------------------------------------------------------------- | Base Path @@ -41,6 +28,58 @@ return [ 'base' => __DIR__.'/..', + /* + |-------------------------------------------------------------------------- + | Configuration Path + |-------------------------------------------------------------------------- + | + | This path is used by the configuration loader to load the application + | configuration files. In general, you should'nt need to change this + | value; however, you can theoretically change the path from here. + | + */ + + 'config' => __DIR__.'/../config', + + /* + |-------------------------------------------------------------------------- + | Database Path + |-------------------------------------------------------------------------- + | + | This path is used by the migration generator and migration runner to + | know where to place your fresh database migration classes. You're + | free to modify the path but you probably will not ever need to. + | + */ + + 'database' => __DIR__.'/../database', + + /* + |-------------------------------------------------------------------------- + | Language Path + |-------------------------------------------------------------------------- + | + | This path is used by the language file loader to load your application + | language files. The purpose of these files is to store your strings + | that are translated into other languages for views, e-mails, etc. + | + */ + + 'lang' => __DIR__.'/../resources/lang', + + /* + |-------------------------------------------------------------------------- + | Public Path + |-------------------------------------------------------------------------- + | + | The public path contains the assets for your web application, such as + | your JavaScript and CSS files, and also contains the primary entry + | point for web requests into these applications from the outside. + | + */ + + 'public' => __DIR__.'/../public', + /* |-------------------------------------------------------------------------- | Storage Path @@ -54,24 +93,4 @@ return [ 'storage' => __DIR__.'/../storage', - /* - |-------------------------------------------------------------------------- - | Generator Paths - |-------------------------------------------------------------------------- - | - | These paths are used by the various class generators and other pieces - | of the framework that need to determine where to store these types - | of classes. Of course, they may be changed to any path you wish. - | - */ - - 'console' => __DIR__.'/../app/Console', - 'config' => __DIR__.'/../config', - 'controllers' => __DIR__.'/../app/Http/Controllers', - 'database' => __DIR__.'/../database', - 'filters' => __DIR__.'/../app/Http/Filters', - 'lang' => __DIR__.'/../resources/lang', - 'providers' => __DIR__.'/../app/Providers', - 'requests' => __DIR__.'/../app/Http/Requests', - ]; diff --git a/config/namespaces.php b/config/namespaces.php deleted file mode 100644 index 1666b5fe..00000000 --- a/config/namespaces.php +++ /dev/null @@ -1,39 +0,0 @@ - 'App\\', - - /* - |-------------------------------------------------------------------------- - | Generator Namespaces - |-------------------------------------------------------------------------- - | - | These namespaces are utilized by the various class generator Artisan - | commands. You are free to change them to whatever you wish or not - | at all. The "app:name" command is the easiest way to set these. - | - */ - - 'console' => 'App\Console\\', - - 'controllers' => 'App\Http\Controllers\\', - - 'filters' => 'App\Http\Filters\\', - - 'providers' => 'App\Providers\\', - - 'requests' => 'App\Http\Requests\\', - -];