2015-07-08 03:34:58 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
|
|
|
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
2019-10-31 17:24:53 -04:00
|
|
|
use Illuminate\Support\Facades\Route;
|
2015-07-08 03:34:58 -04:00
|
|
|
|
|
|
|
class RouteServiceProvider extends ServiceProvider
|
|
|
|
{
|
|
|
|
/**
|
2016-08-19 16:38:49 -04:00
|
|
|
* This namespace is applied to your controller routes.
|
2015-07-08 03:34:58 -04:00
|
|
|
*
|
|
|
|
* In addition, it is set as the URL generator's root namespace.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $namespace = 'App\Http\Controllers';
|
|
|
|
|
2020-02-25 16:26:38 -05:00
|
|
|
/**
|
|
|
|
* The path to the "home" route for your application.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
public const HOME = '/dashboard';
|
|
|
|
|
2015-07-08 03:34:58 -04:00
|
|
|
/**
|
|
|
|
* Define your route model bindings, pattern filters, etc.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2016-08-19 16:38:49 -04:00
|
|
|
public function boot()
|
2015-07-08 03:34:58 -04:00
|
|
|
{
|
|
|
|
//
|
|
|
|
|
2016-08-19 16:38:49 -04:00
|
|
|
parent::boot();
|
2015-07-08 03:34:58 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Define the routes for the application.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2016-08-19 16:38:49 -04:00
|
|
|
public function map()
|
2015-07-08 03:34:58 -04:00
|
|
|
{
|
2016-08-19 16:38:49 -04:00
|
|
|
$this->mapApiRoutes();
|
|
|
|
|
2016-09-06 12:01:36 -04:00
|
|
|
$this->mapWebRoutes();
|
|
|
|
|
2016-08-19 16:38:49 -04:00
|
|
|
//
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Define the "web" routes for the application.
|
|
|
|
*
|
|
|
|
* These routes all receive session state, CSRF protection, etc.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
protected function mapWebRoutes()
|
|
|
|
{
|
2017-01-26 19:17:37 -05:00
|
|
|
Route::middleware('web')
|
|
|
|
->namespace($this->namespace)
|
|
|
|
->group(base_path('routes/web.php'));
|
2016-08-19 16:38:49 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Define the "api" routes for the application.
|
|
|
|
*
|
|
|
|
* These routes are typically stateless.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
protected function mapApiRoutes()
|
|
|
|
{
|
2017-01-26 19:17:37 -05:00
|
|
|
Route::prefix('api')
|
|
|
|
->middleware('api')
|
|
|
|
->namespace($this->namespace)
|
|
|
|
->group(base_path('routes/api.php'));
|
2015-07-08 03:34:58 -04:00
|
|
|
}
|
|
|
|
}
|