Simplify things.

This commit is contained in:
Taylor Otwell 2014-09-27 20:35:07 -05:00
parent cd37f40bba
commit 9f81d4df6e
3 changed files with 57 additions and 79 deletions

View File

@ -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');
}
/**
@ -28,13 +26,13 @@ public function before(Router $router, UrlGenerator $url)
* @return void
*/
public function map()
{
$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->app->booted(function()
{
$this->namespaced('App\Http\Controllers', function(Router $router)
{
require app_path().'/Http/routes.php';
});

View File

@ -15,19 +15,6 @@
'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 @@
'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 @@
'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',
];

View File

@ -1,39 +0,0 @@
<?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\\',
];