Working on routing and providers.
This commit is contained in:
@@ -15,4 +15,13 @@ class EventServiceProvider extends ServiceProvider {
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* The classes to scan for event annotations.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $scan = [
|
||||
//
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
@@ -1,23 +1,39 @@
|
||||
<?php namespace App\Providers;
|
||||
|
||||
use Illuminate\Routing\Router;
|
||||
use Illuminate\Contracts\Routing\UrlGenerator;
|
||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||
|
||||
class RouteServiceProvider extends ServiceProvider {
|
||||
|
||||
/**
|
||||
* The root controller namespace for URL generation.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $rootUrlNamespace = 'App\Http\Controllers';
|
||||
|
||||
/**
|
||||
* The controllers to scan for route annotations.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $scan = [
|
||||
'App\Http\Controllers\HomeController',
|
||||
'App\Http\Controllers\Auth\AuthController',
|
||||
'App\Http\Controllers\Auth\PasswordController',
|
||||
];
|
||||
|
||||
/**
|
||||
* Called before routes are registered.
|
||||
*
|
||||
* Register any model bindings or pattern based filters.
|
||||
*
|
||||
* @param Router $router
|
||||
* @param UrlGenerator $url
|
||||
* @return void
|
||||
*/
|
||||
public function before(Router $router, UrlGenerator $url)
|
||||
public function before(Router $router)
|
||||
{
|
||||
$url->setRootControllerNamespace('App\Http\Controllers');
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -25,18 +41,9 @@ class RouteServiceProvider extends ServiceProvider {
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function map()
|
||||
public function map(Router $router)
|
||||
{
|
||||
// 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->namespaced('App\Http\Controllers', function(Router $router)
|
||||
{
|
||||
require app_path().'/Http/routes.php';
|
||||
});
|
||||
});
|
||||
//
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user