diff --git a/app/Traits/Order/WithAddItem.php b/app/Traits/Order/WithAddItem.php index d5fb7d7..efcb656 100644 --- a/app/Traits/Order/WithAddItem.php +++ b/app/Traits/Order/WithAddItem.php @@ -25,7 +25,7 @@ public function updatedFormBottleId(string $value) return $this->toast('Botol tidak ditemukan, silakan hubungi Administrator.', 'Gagal', 'danger'); } - $formulas = Formula::where('size', $bottle->size)->pluck('quality', 'id')->toArray(); + $formulas = Formula::where('size', $bottle->size)->orderBy('volume')->pluck('quality', 'id')->toArray(); // check if there is any formula if (empty($formulas)) { @@ -44,7 +44,7 @@ public function updatedFormBottleId(string $value) */ public function updatedFormBottleSize(string $value) { - $formulas = Formula::where('size', $value)->pluck('quality', 'id')->toArray(); + $formulas = Formula::where('size', $value)->orderBy('volume')->pluck('quality', 'id')->toArray(); // check if there is any formula if (empty($formulas)) {