We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 464af94 commit 0567794Copy full SHA for 0567794
src/Eloquent/Builder.php
@@ -234,20 +234,11 @@ protected function ensureOrderForCursorPagination($shouldReverse = false)
234
})->toArray();
235
}
236
237
- return $this->mapMongodbOrdersToEloquentOrders($this->query->orders);
238
- }
239
-
240
- private function mapMongodbOrdersToEloquentOrders($orders)
241
- {
242
- $eloquentOrders = [];
243
244
- foreach ($orders as $column => $direction) {
245
- $eloquentOrders[] = [
+ return collect($this->query->orders)->map(function ($direction, $column) {
+ return [
246
'column' => $column,
247
'direction' => $direction === 1 ? 'asc' : 'desc',
248
];
249
250
251
- return collect($eloquentOrders);
+ })->values();
252
253
0 commit comments