| Conditions | 4 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 41 | public function handle($request, Closure $next, $guard = null) |
||
| 42 | { |
||
| 43 | if (Auth::guard($guard)->guest()) { |
||
| 44 | if ($request->ajax() || $request->wantsJson()) { |
||
| 45 | return response('Unauthorized.', 401); |
||
| 46 | } else { |
||
| 47 | return redirect()->guest('login'); |
||
| 48 | } |
||
| 49 | } |
||
| 50 | |||
| 51 | return $next($request); |
||
| 52 | } |
||
| 53 | } |
||
| 54 |