2015-12-13 04:42:28 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
|
|
|
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
2016-09-26 06:30:00 +00:00
|
|
|
use Illuminate\Support\Facades\Route;
|
2015-12-13 04:42:28 +00:00
|
|
|
|
|
|
|
class RouteServiceProvider extends ServiceProvider
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* This namespace is applied to the controller routes in your routes file.
|
|
|
|
*
|
|
|
|
* In addition, it is set as the URL generator's root namespace.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $namespace = 'App\Http\Controllers';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Define your route model bindings, pattern filters, etc.
|
|
|
|
*
|
|
|
|
*/
|
2020-12-22 20:11:22 +00:00
|
|
|
public function boot(): void
|
2015-12-13 04:42:28 +00:00
|
|
|
{
|
2016-09-26 06:30:00 +00:00
|
|
|
parent::boot();
|
2015-12-13 04:42:28 +00:00
|
|
|
}
|
2016-09-26 07:33:53 +00:00
|
|
|
|
2015-12-13 04:42:28 +00:00
|
|
|
/**
|
|
|
|
* Define the routes for the application.
|
|
|
|
*
|
2016-09-26 06:30:00 +00:00
|
|
|
*/
|
2020-12-22 20:11:22 +00:00
|
|
|
public function map(): void
|
2016-09-26 06:30:00 +00:00
|
|
|
{
|
|
|
|
$this->mapApiRoutes();
|
|
|
|
$this->mapWebRoutes();
|
|
|
|
}
|
2016-09-26 07:33:53 +00:00
|
|
|
|
2016-09-26 06:30:00 +00:00
|
|
|
/**
|
|
|
|
* Define the "web" routes for the application.
|
|
|
|
*
|
|
|
|
* These routes all receive session state, CSRF protection, etc.
|
|
|
|
*
|
|
|
|
*/
|
2020-12-22 20:11:22 +00:00
|
|
|
protected function mapWebRoutes(): void
|
2016-09-26 06:30:00 +00:00
|
|
|
{
|
2017-02-14 06:53:02 +00:00
|
|
|
Route::middleware('web')
|
|
|
|
->namespace($this->namespace)
|
|
|
|
->group(base_path('routes/web.php'));
|
2016-09-26 06:30:00 +00:00
|
|
|
}
|
2016-09-26 07:33:53 +00:00
|
|
|
|
2016-09-26 06:30:00 +00:00
|
|
|
/**
|
|
|
|
* Define the "api" routes for the application.
|
|
|
|
*
|
|
|
|
* These routes are typically stateless.
|
2015-12-14 13:22:39 +00:00
|
|
|
*
|
2015-12-13 04:42:28 +00:00
|
|
|
*/
|
2020-12-22 20:11:22 +00:00
|
|
|
protected function mapApiRoutes(): void
|
2015-12-13 04:42:28 +00:00
|
|
|
{
|
2017-02-14 06:53:02 +00:00
|
|
|
Route::prefix('api')
|
|
|
|
->middleware('api')
|
|
|
|
->namespace($this->namespace)
|
|
|
|
->group(base_path('routes/api.php'));
|
2015-12-13 04:42:28 +00:00
|
|
|
}
|
|
|
|
}
|