Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php namespace Anomaly\Streams\Platform\Http\Middleware; |
||
42 | public function handle($request, Closure $next) |
||
43 | { |
||
44 | if ($this->auth->guest()) { |
||
45 | if ($request->ajax()) { |
||
46 | return response('Unauthorized.', 401); |
||
47 | } else { |
||
48 | return redirect()->guest('auth/login'); |
||
49 | } |
||
50 | } |
||
51 | |||
52 | return $next($request); |
||
53 | } |
||
54 | } |
||
55 |
Adding a
@return
annotation 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.