invoiceninja/app/Providers/RouteServiceProvider.php

80 lines
1.6 KiB
PHP
Raw Permalink Normal View History

2017-01-30 21:40:43 +02:00
<?php
namespace App\Providers;
2017-11-15 13:39:24 +02:00
use Illuminate\Support\Facades\Route;
2015-03-12 10:44:39 +10:00
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
/**
2017-11-15 13:39:24 +02:00
* 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
*/
2017-11-14 10:58:08 +02:00
public function boot()
{
2017-11-15 13:39:24 +02:00
//
2017-11-14 10:58:08 +02:00
parent::boot();
}
/**
* Define the routes for the application.
*
2017-11-15 13:39:24 +02:00
* @return void
*/
public function map()
{
$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.php');
});
}
/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
2017-01-30 21:40:43 +02:00
*
* @return void
*/
2017-11-15 13:39:24 +02:00
protected function mapApiRoutes()
{
2017-11-15 13:39:24 +02:00
Route::group([
2017-11-15 16:17:06 +02:00
'middleware' => ['lookup:api', 'api'],
2017-11-15 13:39:24 +02:00
'namespace' => $this->namespace,
2017-11-15 16:17:06 +02:00
'prefix' => 'api/v1',
2017-11-15 13:39:24 +02:00
], function ($router) {
require base_path('routes/api.php');
});
}
2015-03-12 10:44:39 +10:00
}