1 | <?php |
||
18 | class Admin |
||
19 | { |
||
20 | /** |
||
21 | * The authentication guard instance. |
||
22 | * |
||
23 | * @var \Illuminate\Contracts\Auth\Guard |
||
24 | */ |
||
25 | protected $auth; |
||
26 | |||
27 | /** |
||
28 | * Create a new admin middleware instance. |
||
29 | * |
||
30 | * @param \Illuminate\Contracts\Auth\Guard $auth |
||
31 | */ |
||
32 | public function __construct(Guard $auth) |
||
36 | |||
37 | /** |
||
38 | * We're verifying that the current user is logged in to Gitamin and is an admin level. |
||
39 | * |
||
40 | * @param \Illuminate\Http\Request $request |
||
41 | * @param \Closure $next |
||
42 | * |
||
43 | * @return mixed |
||
44 | */ |
||
45 | public function handle($request, Closure $next) |
||
53 | } |
||
54 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: