Passed
Push — master ( fe6e69...4f1c4f )
by Mohamed
09:34
created

Cors   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 5
c 1
b 0
f 1
dl 0
loc 15
rs 10
wmc 1

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
7
class Cors
8
{
9
    /**
10
     * Handle an incoming request.
11
     *
12
     * @param  \Illuminate\Http\Request  $request
13
     * @param  \Closure  $next
14
     * @return mixed
15
     */
16
    public function handle($request, Closure $next)
17
    {
18
        return $next($request)
19
            ->header('Access-Control-Allow-Origin', '*')
20
            ->header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS')
21
            ->header('Access-Control-Allow-Headers', 'X-Requested-With, Content-Type, X-Token-Auth, Authorization');
22
    }
23
}
24