From c7564bcc46e9cd1258c92569cde510f56ec548e8 Mon Sep 17 00:00:00 2001 From: "allen.yan" Date: Tue, 29 Jul 2025 16:28:52 +0800 Subject: [PATCH] =?UTF-8?q?20250729=20=E8=AA=BF=E6=95=B4=E8=B3=87=E6=96=99?= =?UTF-8?q?=E7=95=B0=E5=B8=B8=E5=95=8F=E9=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Livewire/Grids/RoomGrid.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Livewire/Grids/RoomGrid.php b/app/Livewire/Grids/RoomGrid.php index 903a000..2e772f6 100644 --- a/app/Livewire/Grids/RoomGrid.php +++ b/app/Livewire/Grids/RoomGrid.php @@ -15,6 +15,7 @@ class RoomGrid extends Component public ?int $selectedBranchId = null; public string $external_ip= ""; public array $roomTypes; + public $room; public function mount() { @@ -34,12 +35,12 @@ class RoomGrid extends Component public function render() { - $rooms = Room::where('branch_id', $this->selectedBranchId)->orderBy('name')->get(); + $this->rooms = Room::where('branch_id', $this->selectedBranchId)->orderBy('name')->get(); - $floors = $rooms->pluck('floor')->unique()->sort()->values()->toArray(); + $floors = $this->rooms->pluck('floor')->unique()->sort()->values()->toArray(); return view('livewire.grids.room-grid', [ - 'rooms' => $rooms, + 'rooms' => $this->rooms, 'floors' => $floors, ]); }