VerifyCsrfToken   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 8 1
1
<?php
2
3
namespace Thinktomorrow\Chief\App\Http\Middleware;
4
5
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
6
7
class VerifyCsrfToken extends BaseVerifier
8
{
9
    /**
10
     * The URIs that should be excluded from CSRF verification.
11
     *
12
     * @var array
13
     */
14
    protected $except = [
15
        //
16
    ];
17
18
    public function handle($request, \Closure $next)
19
    {
20
        $adminRoute = config('chief.route.prefix', '/admin');
21
22
        // Add exception routes for all chief admin endpoints.
23
        $this->except[] = rtrim($adminRoute, '/') . '/*';
24
25
        return parent::handle($request, $next);
26
    }
27
}
28