| Conditions | 4 |
| Paths | 3 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function handle($request, Closure $next, $guard = null) |
||
| 19 | { |
||
| 20 | if (Auth::guard($guard)->guest()) { |
||
| 21 | if ($request->ajax() || $request->wantsJson()) { |
||
| 22 | return response('Unauthorized.', 401); |
||
| 23 | } |
||
| 24 | |||
| 25 | return redirect()->guest('login'); |
||
| 26 | } |
||
| 27 | |||
| 28 | return $next($request); |
||
| 29 | } |
||
| 30 | } |
||
| 31 |