Completed
Push — development ( b0aa59...26b42c )
by Claudio
02:36
created

Cors   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 16
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
 * @package App\Http\Middleware
12
 */
13
class Cors
14
{
15
    /**
16
     * Handle an incoming request.
17
     *
18
     * @param  Request $request
19
     * @param  Closure $next
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