diff --git a/code/app/Delivery.php b/code/app/Delivery.php index a22fd2c7..f3777bbb 100644 --- a/code/app/Delivery.php +++ b/code/app/Delivery.php @@ -49,7 +49,7 @@ private static function sortByUserName($bookings) private static function sortByPlace($bookings) { - usort($bookings, function ($a, $b) { + return $bookings->sortBy([function ($a, $b) { $a_place = $a->shipping_place; $b_place = $b->shipping_place; @@ -74,7 +74,7 @@ private static function sortByPlace($bookings) } return $ret; - }); + }]); return $bookings; }