Commit 4b5e86ed authored by Nicolas Widart's avatar Nicolas Widart

New routes SP structure.

parent 76af884a
<?php namespace Modules\User\Providers; <?php namespace Modules\User\Providers;
use Illuminate\Routing\Router; use Illuminate\Routing\Router;
use Illuminate\Contracts\Routing\UrlGenerator;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider class RouteServiceProvider extends ServiceProvider
{ {
/** /**
* Called before routes are registered. * The root namespace to assume when generating URLs to actions.
* *
* Register any model bindings or pattern based filters. * @var string
* */
* @param Router $router protected $rootUrlNamespace = 'Modules\User\Http\Controllers';
* @param UrlGenerator $url
* @return void /**
*/ * The controllers to scan for route annotations.
public function before(Router $router, UrlGenerator $url) *
{ * @var array
$url->setRootControllerNamespace('Modules\User\Http\Controllers'); */
} protected $scan = [
'Modules\User\Http\Controllers',
];
/**
* Called before routes are registered.
*
* Register any model bindings or pattern based filters.
*
* @param Router $router
* @return void
*/
public function before(Router $router)
{
//
}
/**
* Define the routes for the application.
*
* @return void
*/
public function map(Router $router)
{
require __DIR__ . '/../Http/routes.php';
}
/**
* Define the routes for the application.
*
* @return void
*/
public function map()
{
$this->app->booted(function()
{
$this->namespaced('Modules\User\Http\Controllers', function(Router $router)
{
require __DIR__ . '/../Http/routes.php';
});
});
}
} }
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