| Conditions | 4 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function handle(Request $request, Closure $next) |
||
| 19 | { |
||
| 20 | if ($this->auth->guest()) { |
||
| 21 | if ($request->ajax() || $request->route()->getName() === 'play') { |
||
| 22 | return response('Unauthorized.', 401); |
||
| 23 | } else { |
||
| 24 | return redirect()->guest('login'); |
||
| 25 | } |
||
| 26 | } |
||
| 27 | |||
| 28 | return $next($request); |
||
| 29 | } |
||
| 31 |