1 | <?php |
||
13 | trait UsedByTeams |
||
14 | { |
||
15 | /** |
||
16 | * Boot the global scope. |
||
17 | */ |
||
18 | protected static function bootUsedByTeams() |
||
34 | |||
35 | /** |
||
36 | * @param Builder $query |
||
37 | * @return mixed |
||
38 | */ |
||
39 | public function scopeAllTeams(Builder $query) |
||
43 | |||
44 | /** |
||
45 | * @return mixed |
||
46 | */ |
||
47 | public function team() |
||
51 | |||
52 | /** |
||
53 | * @throws Exception |
||
54 | */ |
||
55 | protected static function teamGuard() |
||
61 | } |
||
62 |
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: