snipe-it/app/Providers/RouteServiceProvider.php

88 lines
2.1 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');
2016-12-15 06:11:03 -08:00
require base_path('routes/web/models.php');
require base_path('routes/web/accessories.php');
require base_path('routes/web/licenses.php');
require base_path('routes/web/consumables.php');
require base_path('routes/web/fields.php');
2016-12-15 19:59:42 -08:00
require base_path('routes/web/components.php');
2016-12-15 20:52:39 -08:00
require base_path('routes/web/users.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([
2017-01-11 14:50:38 -08:00
'middleware' => 'auth:api',
2016-12-14 04:32:24 -08:00
'namespace' => $this->namespace,
'prefix' => 'api',
], function ($router) {
require base_path('routes/api.php');
2016-03-25 01:18:05 -07:00
});
}
}