1 | <?php |
||
12 | class Authorize |
||
13 | { |
||
14 | /** |
||
15 | * Handle an incoming request. |
||
16 | * |
||
17 | * @param \Illuminate\Http\Request $request |
||
18 | * @param \Closure $next |
||
19 | * @param string|array $ability |
||
20 | * |
||
21 | * @throws \Illuminate\Auth\AuthenticationException |
||
22 | * @throws \Napp\Core\Api\Exceptions\Exceptions\AuthorizationException |
||
23 | * |
||
24 | * @return mixed |
||
25 | */ |
||
26 | 6 | public function handle($request, Closure $next, ...$ability) |
|
40 | } |
||
41 |
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: