File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -196,24 +196,24 @@ private function manipulateCollection($results)
196196 * Make response meta
197197 *
198198 * If a callable is given as an element value then
199- * the result collection is passed to it as the first
200- * parameter
199+ * the query and collection as parameters
201200 *
202201 * `disallow_ordering_by` will always be overwritten
203202 * as it is managed internally
204203 *
204+ * @param Builder $query
205205 * @param Collection $collection
206206 * @return array
207207 */
208- private function makeMeta (Collection $ collection )
208+ private function makeMeta (Builder $ query , Collection $ collection )
209209 {
210210 $ meta = $ this ->meta ;
211211 $ out = [];
212212
213213 foreach ($ meta as $ element => $ value ) {
214214 if (is_callable ($ value )) {
215215 $ out [$ element ] = call_user_func_array (
216- $ value , [$ collection ]
216+ $ value , [$ query , $ collection ]
217217 );
218218
219219 continue ;
@@ -265,7 +265,7 @@ public function respond()
265265
266266 $ results = $ this ->paginateQuery ($ query );
267267 $ results = $ this ->manipulateCollection ($ results );
268- $ meta = $ this ->makeMeta ($ results ->getCollection ());
268+ $ meta = $ this ->makeMeta ($ query , $ results ->getCollection ());
269269
270270 return DataTableResponse::success ($ results , $ meta )->json ();
271271 }
You can’t perform that action at this time.
0 commit comments