VerifyCsrfToken::handle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 2
dl 0
loc 8
rs 10
c 0
b 0
f 0
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