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