for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Modules\Example\Providers;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Route;
class RouteServiceProvider extends ServiceProvider
{
/**
* The root namespace to assume when generating URLs to actions.
*
* @var string
*/
protected $namespace = 'Modules\Example\Http\Controllers';
* Called before routes are registered.
* Register any model bindings or pattern based filters.
* @return void
public function boot()
parent::boot();
}
* Define the routes for the application.
public function map()
$this->mapApiRoutes();
$this->mapWebRoutes();
$this->mapCommandRoutes();
* Define the "web" routes for the application.
* These routes all receive session state, CSRF protection, etc.
protected function mapWebRoutes()
Route::middleware('web')
->namespace($this->namespace)
->group(__DIR__.'/../Routes/web.php');
* Define the "api" routes for the application.
* These routes are typically stateless.
protected function mapApiRoutes()
Route::prefix('api')
->middleware('api')
->group(__DIR__.'/../Routes/api.php');
* Define the "console" routes for the application.
* These routes are console commands.
protected function mapCommandRoutes()
$commands = require __DIR__.'/../Routes/console.php';
$this->commands($commands);