forked from statamic/cms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroutes.php
35 lines (30 loc) · 1.02 KB
/
routes.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
use Illuminate\Support\Facades\Route;
use Statamic\API\Middleware\Cache;
use Statamic\Facades\Glide;
use Statamic\Http\Middleware\CP\SwapExceptionHandler as SwapCpExceptionHandler;
use Statamic\Http\Middleware\RequireStatamicPro;
if (config('statamic.api.enabled')) {
Route::middleware([
RequireStatamicPro::class,
Cache::class,
])->group(function () {
Route::middleware(config('statamic.api.middleware'))
->name('statamic.api.')
->prefix(config('statamic.api.route'))
->group(__DIR__.'/api.php');
});
}
if (config('statamic.cp.enabled')) {
Route::middleware(SwapCpExceptionHandler::class)->group(function () {
Route::middleware('statamic.cp')
->name('statamic.cp.')
->prefix(config('statamic.cp.route'))
->group(__DIR__.'/cp.php');
});
}
if (Glide::shouldServeByHttp()) {
require __DIR__.'/glide.php';
}
Route::middleware(config('statamic.routes.middleware', 'web'))
->group(__DIR__.'/web.php');