diff --git a/app/Livewire/Forms/RoomGridForm.php b/app/Livewire/Forms/RoomGridForm.php index 03c87d6..a0b9e90 100644 --- a/app/Livewire/Forms/RoomGridForm.php +++ b/app/Livewire/Forms/RoomGridForm.php @@ -31,7 +31,7 @@ class RoomGridForm extends Component $floors = []; if ($branch) { - $rooms = Room::where('branch_id', $branch->id)->get(); + $rooms = Room::where('branch_id', $branch->id)->orderBy('name', 'asc')->get(); $floors = $rooms->pluck('floor')->unique()->sort()->values()->toArray(); } diff --git a/app/Livewire/Tables/RoomTable.php b/app/Livewire/Tables/RoomTable.php index 402c7f0..175887d 100644 --- a/app/Livewire/Tables/RoomTable.php +++ b/app/Livewire/Tables/RoomTable.php @@ -74,7 +74,7 @@ final class RoomTable extends PowerGridComponent public function datasource(): Builder { - return Room::query(); + return Room::query()->orderBy('name', 'asc'); } public function relationSearch(): array