| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php namespace App\Http\Middleware; |
||
| 33 | public function handle($request, Closure $next) |
||
| 34 | { |
||
| 35 | if ($this->auth->guest()) |
||
| 36 | { |
||
| 37 | if ($request->ajax()) |
||
| 38 | { |
||
| 39 | return response('Unauthorized.', 401); |
||
| 40 | } |
||
| 41 | else |
||
| 42 | { |
||
| 43 | return redirect()->guest('auth/login'); |
||
| 44 | } |
||
| 45 | } |
||
| 46 | |||
| 47 | return $next($request); |
||
| 48 | } |
||
| 49 | |||
| 51 |
Adding a
@returnannotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.