From ded3279dd814321115034a57754e0e6d3831f0a0 Mon Sep 17 00:00:00 2001 From: Mohamed Said Date: Mon, 24 Jul 2017 20:39:40 +0200 Subject: [PATCH] Ignore removal for raw order (#20236) --- src/Illuminate/Database/Query/Builder.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Database/Query/Builder.php b/src/Illuminate/Database/Query/Builder.php index 0be6f364f43d..f75ca304875a 100755 --- a/src/Illuminate/Database/Query/Builder.php +++ b/src/Illuminate/Database/Query/Builder.php @@ -1562,7 +1562,7 @@ public function forPageAfterId($perPage = 15, $lastId = 0, $column = 'id') } /** - * Get an array orders with all orders for an given column removed. + * Get an array with all orders with a given column removed. * * @param string $column * @return array @@ -1571,7 +1571,8 @@ protected function removeExistingOrdersFor($column) { return Collection::make($this->orders) ->reject(function ($order) use ($column) { - return $order['column'] === $column; + return isset($order['column']) + ? $order['column'] === $column : false; })->values()->all(); }