| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 7 |
| Ratio | 58.33 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | public function handle($request, Closure $next) |
||
| 36 | { |
||
| 37 | View Code Duplication | if ($this->auth->guest()) { |
|
| 38 | if ($request->ajax()) { |
||
| 39 | return response('Unauthorized.', 401); |
||
| 40 | } else { |
||
| 41 | return redirect()->guest('auth/login'); |
||
| 42 | } |
||
| 43 | } |
||
| 44 | |||
| 45 | return $next($request); |
||
| 46 | } |
||
| 47 | } |
||
| 48 |
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.