Commit 9f81d4df authored by Taylor Otwell's avatar Taylor Otwell

Simplify things.

parent cd37f40b
...@@ -17,9 +17,7 @@ class RouteServiceProvider extends ServiceProvider { ...@@ -17,9 +17,7 @@ class RouteServiceProvider extends ServiceProvider {
*/ */
public function before(Router $router, UrlGenerator $url) public function before(Router $router, UrlGenerator $url)
{ {
$url->setRootControllerNamespace( $url->setRootControllerNamespace('App\Http\Controllers');
trim(config('namespaces.controllers'), '\\')
);
} }
/** /**
...@@ -29,12 +27,12 @@ class RouteServiceProvider extends ServiceProvider { ...@@ -29,12 +27,12 @@ class RouteServiceProvider extends ServiceProvider {
*/ */
public function map() 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() $this->app->booted(function()
{ {
// Once the application has booted, we will include the default routes $this->namespaced('App\Http\Controllers', function(Router $router)
// file. This "namespace" helper will load the routes file within a
// route group which automatically sets the controller namespace.
$this->namespaced(function(Router $router)
{ {
require app_path().'/Http/routes.php'; require app_path().'/Http/routes.php';
}); });
......
...@@ -17,61 +17,80 @@ return [ ...@@ -17,61 +17,80 @@ return [
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Public Path | Base Path
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| The public path contains the assets for your web application, such as | The base path is the root of the Laravel installation. Most likely you
| your JavaScript and CSS files, and also contains the primary entry | will not need to change this value. But, if for some wild reason it
| point for web requests into these applications from the outside. | is necessary you will do so here, just proceed with some caution.
| |
*/ */
'public' => __DIR__.'/../public', 'base' => __DIR__.'/..',
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Base Path | Configuration Path
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| The base path is the root of the Laravel installation. Most likely you | This path is used by the configuration loader to load the application
| will not need to change this value. But, if for some wild reason it | configuration files. In general, you should'nt need to change this
| is necessary you will do so here, just proceed with some caution. | value; however, you can theoretically change the path from here.
| |
*/ */
'base' => __DIR__.'/..', 'config' => __DIR__.'/../config',
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Storage Path | Database Path
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| The storage path is used by Laravel to store cached Blade views, logs | This path is used by the migration generator and migration runner to
| and other pieces of information. You may modify the path here when | know where to place your fresh database migration classes. You're
| you want to change the location of this directory for your apps. | free to modify the path but you probably will not ever need to.
| |
*/ */
'storage' => __DIR__.'/../storage', 'database' => __DIR__.'/../database',
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Generator Paths | Language Path
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| These paths are used by the various class generators and other pieces | This path is used by the language file loader to load your application
| of the framework that need to determine where to store these types | language files. The purpose of these files is to store your strings
| of classes. Of course, they may be changed to any path you wish. | that are translated into other languages for views, e-mails, etc.
| |
*/ */
'console' => __DIR__.'/../app/Console',
'config' => __DIR__.'/../config',
'controllers' => __DIR__.'/../app/Http/Controllers',
'database' => __DIR__.'/../database',
'filters' => __DIR__.'/../app/Http/Filters',
'lang' => __DIR__.'/../resources/lang', 'lang' => __DIR__.'/../resources/lang',
'providers' => __DIR__.'/../app/Providers',
'requests' => __DIR__.'/../app/Http/Requests', /*
|--------------------------------------------------------------------------
| 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
|--------------------------------------------------------------------------
|
| The storage path is used by Laravel to store cached Blade views, logs
| and other pieces of information. You may modify the path here when
| you want to change the location of this directory for your apps.
|
*/
'storage' => __DIR__.'/../storage',
]; ];
<?php
return [
/*
|--------------------------------------------------------------------------
| Application Namespace
|--------------------------------------------------------------------------
|
| This is the root namespace used by the various Laravel generator tasks
| that are able to build controllers, console commands and many other
| classes for you. You may set the name via the "app:name" command.
|
*/
'root' => '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\\',
];
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment