| Conditions | 3 |
| Paths | 4 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php namespace Arcanesoft\Foundation\Http\Middleware; |
||
| 27 | public function handle(Request $request, Closure $next) |
||
| 28 | { |
||
| 29 | if (is_null($user = $request->user())) { |
||
| 30 | abort(404, 'Guest not allowed !'); |
||
| 31 | } |
||
| 32 | |||
| 33 | if ( ! $this->isAdmin($user)) { |
||
| 34 | abort(404, 'User not allowed !'); |
||
| 35 | } |
||
| 36 | |||
| 37 | return $next($request); |
||
| 38 | } |
||
| 39 | |||
| 56 |