File tree 1 file changed +5
-5
lines changed
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)
196
196
* Make response meta
197
197
*
198
198
* 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
201
200
*
202
201
* `disallow_ordering_by` will always be overwritten
203
202
* as it is managed internally
204
203
*
204
+ * @param Builder $query
205
205
* @param Collection $collection
206
206
* @return array
207
207
*/
208
- private function makeMeta (Collection $ collection )
208
+ private function makeMeta (Builder $ query , Collection $ collection )
209
209
{
210
210
$ meta = $ this ->meta ;
211
211
$ out = [];
212
212
213
213
foreach ($ meta as $ element => $ value ) {
214
214
if (is_callable ($ value )) {
215
215
$ out [$ element ] = call_user_func_array (
216
- $ value , [$ collection ]
216
+ $ value , [$ query , $ collection ]
217
217
);
218
218
219
219
continue ;
@@ -265,7 +265,7 @@ public function respond()
265
265
266
266
$ results = $ this ->paginateQuery ($ query );
267
267
$ results = $ this ->manipulateCollection ($ results );
268
- $ meta = $ this ->makeMeta ($ results ->getCollection ());
268
+ $ meta = $ this ->makeMeta ($ query , $ results ->getCollection ());
269
269
270
270
return DataTableResponse::success ($ results , $ meta )->json ();
271
271
}
You can’t perform that action at this time.
0 commit comments