1 | <?php |
||
10 | class EloquentSource implements SourceInterface |
||
11 | { |
||
12 | /** |
||
13 | * @var \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Model |
||
14 | */ |
||
15 | protected $source; |
||
16 | |||
17 | /** |
||
18 | * @param \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Model $source |
||
19 | */ |
||
20 | public function __construct($source) |
||
24 | |||
25 | /** |
||
26 | * @param Column[] $columns |
||
27 | */ |
||
28 | public function applyFilters($columns) |
||
37 | |||
38 | /** |
||
39 | * @param int $perPage |
||
40 | * @param int $currentPage |
||
41 | * @param Order $order |
||
42 | * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator |
||
43 | */ |
||
44 | public function execute($perPage, $currentPage, Order $order) |
||
54 | |||
55 | /** |
||
56 | * @return int |
||
57 | */ |
||
58 | public function total() |
||
62 | |||
63 | /** |
||
64 | * @param Column $column |
||
65 | */ |
||
66 | protected function buildQuery(Column $column) |
||
81 | |||
82 | /** |
||
83 | * @param string|string[] $value |
||
84 | * @param string $operator |
||
85 | * @return mixed |
||
86 | */ |
||
87 | protected function normalizeValue($value, $operator) |
||
99 | } |
||
100 |
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: