Conditions | 4 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php namespace WITR\Http\Middleware; |
||
42 | public function handle($request, Closure $next) |
||
43 | { |
||
44 | if ($this->auth->guest() && !$this->whitelist->inRange($request)) |
||
45 | { |
||
46 | if ($request->ajax()) |
||
47 | { |
||
48 | return response('Unauthorized.', 401); |
||
49 | } |
||
50 | else |
||
51 | { |
||
52 | return redirect()->guest('auth/login'); |
||
53 | } |
||
54 | } |
||
55 | |||
56 | return $next($request); |
||
57 | } |
||
58 | |||
60 |
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.