snipe-it/app/Providers/RouteServiceProvider.php

84 lines
1.9 KiB
PHP
Raw Normal View History

2016-03-25 01:18:05 -07:00
<?php
namespace App\Providers;
2016-12-14 04:32:24 -08:00
use Illuminate\Support\Facades\Route;
2016-03-25 01:18:05 -07:00
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
/**
2016-12-14 04:32:24 -08:00
* This namespace is applied to your controller routes.
2016-03-25 01:18:05 -07:00
*
* 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-12-14 04:32:24 -08:00
public function boot()
2016-03-25 01:18:05 -07:00
{
//
2016-12-14 04:32:24 -08:00
parent::boot();
2016-03-25 01:18:05 -07:00
}
/**
* Define the routes for the application.
*
* @return void
*/
2016-12-14 04:32:24 -08:00
public function map()
2016-03-25 01:18:05 -07:00
{
2016-12-14 04:32:24 -08:00
$this->mapApiRoutes();
$this->mapWebRoutes();
//
}
/**
* Define the "web" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapWebRoutes()
{
Route::group([
'middleware' => 'web',
'namespace' => $this->namespace,
], function ($router) {
require base_path('routes/web/hardware.php');
require base_path('routes/web/accessories.php');
require base_path('routes/web/licenses.php');
require base_path('routes/web/consumables.php');
2016-12-14 04:32:24 -08:00
require base_path('routes/web.php');
});
}
/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*
* @return void
*/
protected function mapApiRoutes()
{
Route::group([
'middleware' => 'api',
'namespace' => $this->namespace,
'prefix' => 'api',
], function ($router) {
require base_path('routes/api.php');
2016-03-25 01:18:05 -07:00
});
}
}