1 | <?php |
||
7 | class Polar |
||
8 | { |
||
9 | public static function scriptVariables() |
||
10 | { |
||
11 | return [ |
||
12 | 'csrfToken' => csrf_token(), |
||
13 | 'userId' => auth()->id(), |
||
|
|||
14 | 'route' => config('polar.route'), |
||
15 | 'api_route' => config('polar.api_route'), |
||
16 | ]; |
||
17 | } |
||
18 | |||
19 | public static function userModel() |
||
23 | |||
24 | public function admins() : Collection |
||
31 | } |
||
32 |
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: