| Conditions | 3 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public function handle($request, Closure $next) |
||
| 18 | { |
||
| 19 | if (env('APP_ENV') !== 'testing') { |
||
| 20 | header('Access-Control-Allow-Origin: *'); |
||
| 21 | header('Access-Control-Allow-Credentials: true'); |
||
| 22 | header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS'); |
||
|
|
|||
| 23 | header('Access-Control-Allow-Headers: Origin, Content-Type, Accept, Authorization, token, _'); |
||
| 24 | header('Content-Type: application/json; charset=utf-8'); |
||
| 25 | } |
||
| 26 | |||
| 27 | if ($request->getRealMethod() == 'OPTIONS') { |
||
| 28 | return new \Illuminate\Http\Response('OK', 200); |
||
| 29 | } |
||
| 30 | |||
| 31 | return $next($request); |
||
| 32 | } |
||
| 33 | } |
||
| 34 |
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.