1 | <?php |
||
19 | trait Sortable |
||
20 | { |
||
21 | /** |
||
22 | * Append many column sorting to query builder. |
||
23 | * |
||
24 | * @param array $columns |
||
25 | * |
||
26 | * @return $this |
||
27 | */ |
||
28 | 16 | public function multiSortBy(array $columns) |
|
40 | |||
41 | /** |
||
42 | * Append relation column sorting to query builder. |
||
43 | * |
||
44 | * @param array $column |
||
45 | * @param string $direction |
||
46 | * |
||
47 | * @return $this |
||
48 | */ |
||
49 | 2 | public function sortByRelation($column, $direction = 'ASC') |
|
80 | |||
81 | /** |
||
82 | * Add joining the tables to query based on the type of relationship. |
||
83 | * |
||
84 | * @param Relation $relationClass |
||
85 | * |
||
86 | * @return $this |
||
87 | */ |
||
88 | 2 | protected function joinRelation(Relation $relationClass) |
|
106 | |||
107 | /** |
||
108 | * Join a belongs to many relationship. |
||
109 | * |
||
110 | * @param BelongsToMany $relation |
||
111 | * |
||
112 | * @return mixed |
||
113 | */ |
||
114 | protected function joinBelongsToMany(BelongsToMany $relation) |
||
128 | |||
129 | /** |
||
130 | * Join a belongs to relationship. |
||
131 | * |
||
132 | * @param BelongsTo $relation |
||
133 | * |
||
134 | * @return mixed |
||
135 | */ |
||
136 | 2 | protected function joinBelongsTo(BelongsTo $relation) |
|
145 | |||
146 | /** |
||
147 | * Join a has one relationship. |
||
148 | * |
||
149 | * @param HasOneOrMany $relation |
||
150 | * |
||
151 | * @return mixed |
||
152 | */ |
||
153 | 2 | protected function joinHasOneOrMany(HasOneOrMany $relation) |
|
162 | |||
163 | /** |
||
164 | * Append column sorting to query builder. |
||
165 | * |
||
166 | * @param string|array $column |
||
167 | * @param string $direction |
||
168 | * |
||
169 | * @return $this |
||
170 | */ |
||
171 | 2 | public function sortBy($column, $direction = 'ASC') |
|
177 | } |
||
178 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: