photo/app/Providers/RouteServiceProvider.php

74 lines
1.5 KiB
PHP
Raw Normal View History

2016-06-20 13:35:59 +00:00
<?php
namespace App\Providers;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
2019-11-08 12:08:34 +00:00
use Illuminate\Support\Facades\Route;
2016-06-20 13:35:59 +00:00
class RouteServiceProvider extends ServiceProvider
{
/**
* This namespace is applied to your controller routes.
*
* 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.
*
* @return void
*/
public function boot()
2016-06-20 13:35:59 +00:00
{
//
parent::boot();
2016-06-20 13:35:59 +00:00
}
/**
* Define the routes for the application.
*
* @return void
*/
2019-11-08 12:08:34 +00:00
public function map()
2016-06-20 13:35:59 +00:00
{
2019-11-08 12:08:34 +00:00
$this->mapApiRoutes();
$this->mapWebRoutes();
2016-06-20 13:35:59 +00:00
//
}
/**
* Define the "web" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
2019-11-08 12:08:34 +00:00
protected function mapWebRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php'));
}
/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*
* @return void
*/
protected function mapApiRoutes()
2016-06-20 13:35:59 +00:00
{
2019-11-08 12:08:34 +00:00
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
2016-06-20 13:35:59 +00:00
}
}