1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00
invoiceninja/app/Providers/RouteServiceProvider.php

80 lines
1.6 KiB
PHP
Raw Normal View History

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