1 | <?php |
||
8 | class BelongsTo extends Select |
||
9 | { |
||
10 | /** |
||
11 | * @param string|Builder $class |
||
12 | * @param string $text |
||
13 | * @param string $id |
||
14 | * @param string|null $foreign |
||
15 | * @return \Yajra\DataTables\Html\Editor\Fields\Field|static |
||
16 | */ |
||
17 | public static function model($class, $text, $id = 'id', $foreign = null) |
||
31 | |||
32 | /** |
||
33 | * Add a placeholder and allow clear. |
||
34 | * Note: This requires editor select2 plugin. |
||
35 | * |
||
36 | * @see https://editor.datatables.net/plug-ins/field-type/editor.select2 |
||
37 | * @param string $text |
||
38 | * @param null|string $id |
||
39 | * @param bool $allowClear |
||
40 | * @return $this |
||
41 | */ |
||
42 | public function placeholder($text, $id = null, $allowClear = true) |
||
55 | } |
||
56 |
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: