1 | <?php |
||
8 | class PermissionMiddleware |
||
9 | { |
||
10 | /** |
||
11 | * Handle an incoming request. |
||
12 | * |
||
13 | * @param \Illuminate\Http\Request $request |
||
14 | * @param \Closure $next |
||
15 | * @param string $permission |
||
16 | * @return mixed |
||
17 | */ |
||
18 | public function handle(Request $request, Closure $next, string $permission) |
||
36 | } |
||
37 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: