1 | <?php namespace Distilleries\DatatableBuilder; |
||
9 | abstract class EloquentDatatable { |
||
10 | |||
11 | protected $model; |
||
12 | protected $colomns; |
||
13 | protected $form = null; |
||
14 | protected $colomnsDisplay = []; |
||
15 | protected $datatableOptions = []; |
||
16 | |||
17 | // 0 can be an integer to represents the column's number or it can be a string that references the column's name |
||
18 | protected $defaultOrder = [[0, 'desc']]; |
||
19 | |||
20 | // ------------------------------------------------------------------------------------------------ |
||
21 | |||
22 | 8 | public function __construct(Model $model = null) |
|
26 | |||
27 | /** |
||
28 | * @param Eloquent $model |
||
29 | */ |
||
30 | 4 | public function setModel(Model $model) |
|
34 | |||
35 | |||
36 | // ------------------------------------------------------------------------------------------------ |
||
37 | |||
38 | /** |
||
39 | * @param string $name |
||
40 | * @param \Closure $closure |
||
41 | */ |
||
42 | 8 | public function add($name, $closure = null, $translation = '') |
|
60 | |||
61 | /** |
||
62 | * @param string $translation |
||
63 | * @param string $name |
||
64 | */ |
||
65 | 8 | public function addTranslation($name, $translation) |
|
69 | |||
70 | // ------------------------------------------------------------------------------------------------ |
||
71 | |||
72 | 4 | public function applyFilters() |
|
86 | |||
87 | // ------------------------------------------------------------------------------------------------ |
||
88 | |||
89 | 4 | public function generateColomns() |
|
122 | |||
123 | 4 | public function setClassRow($datatable) |
|
133 | |||
134 | // ------------------------------------------------------------------------------------------------ |
||
135 | 8 | public function generateHtmlRender($template = 'datatable-builder::part.datatable', $route = '') |
|
144 | |||
145 | // ------------------------------------------------------------------------------------------------ |
||
146 | 8 | public function addDefaultAction($template = 'datatable-builder::form.components.datatable.actions', $route = '') |
|
159 | |||
160 | // ------------------------------------------------------------------------------------------------ |
||
161 | // ------------------------------------------------------------------------------------------------ |
||
162 | // ------------------------------------------------------------------------------------------------ |
||
163 | |||
164 | |||
165 | 8 | protected function addFilter($template = 'datatable-builder::form.components.datatable.filter') |
|
178 | |||
179 | // ------------------------------------------------------------------------------------------------ |
||
180 | // ------------------------------------------------------------------------------------------------ |
||
181 | // ------------------------------------------------------------------------------------------------ |
||
182 | |||
183 | |||
184 | 8 | protected function addOptions() |
|
208 | |||
209 | // ------------------------------------------------------------------------------------------------ |
||
210 | |||
211 | 8 | protected function getControllerNameForAction() { |
|
216 | |||
217 | // ------------------------------------------------------------------------------------------------ |
||
218 | |||
219 | 3 | public function filters() |
|
225 | |||
226 | // ------------------------------------------------------------------------------------------------ |
||
227 | // ------------------------------------------------------------------------------------------------ |
||
228 | // ------------------------------------------------------------------------------------------------ |
||
229 | |||
230 | abstract public function build(); |
||
231 | } |
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: