Cors::handle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 7
rs 10
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace App\Http\Middleware;
6
7
use Closure;
8
9
final class Cors
10
{
11
    public function handle($request, Closure $next)
12
    {
13
        return $next($request)
14
            ->header('Access-Control-Allow-Origin', '*')
15
            ->header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS')
16
            ->header('Access-Control-Allow-Headers', 'Origin, Content-Type, Accept, Authorization, X-Requested-With')
17
            ->header('Access-Control-Allow-Credentials', 'true');
18
    }
19
}
20