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