Cors   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 17
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 6 1
1
<?php
2
3
namespace App\Http\Middleware;
4
5
use Closure;
6
use Illuminate\Http\Request;
7
use Illuminate\Support\Facades\Config;
8
9
/**
10
 * Class Cors.
11
 */
12
class Cors
13
{
14
    /**
15
     * Handle an incoming request.
16
     *
17
     * @param Request $request
18
     * @param Closure $next
19
     *
20
     * @return mixed
21
     */
22
    public function handle($request, Closure $next)
23
    {
24
        return $next($request)
25
            ->header('Access-Control-Allow-Origin', implode(',', Config::get('chocolatey.cors')))
26
            ->header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
27
    }
28
}
29