koel/app/Providers/RouteServiceProvider.php

70 lines
1.5 KiB
PHP
Raw Normal View History

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.
*
* @return void
*/
2016-09-26 06:30:00 +00:00
public function boot()
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
* @return void
*/
public function map()
{
$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.
*
* @return void
*/
protected function mapWebRoutes()
{
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
* @return void
*/
2016-09-26 06:30:00 +00:00
protected function mapApiRoutes()
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
}
}