diff --git a/app/Livewire/Grids/RoomGrid.php b/app/Livewire/Grids/RoomGrid.php index d0ad6e9..3358169 100644 --- a/app/Livewire/Grids/RoomGrid.php +++ b/app/Livewire/Grids/RoomGrid.php @@ -33,6 +33,7 @@ class RoomGrid extends Component if ($branch) { $rooms = Room::where('branch_id', $branch->id)->orderBy('name', 'asc')->get(); $floors = $rooms->pluck('floor')->unique()->sort()->values()->toArray(); + array_unshift($floors, 'all'); } return view('livewire.grids.room-grid', [ diff --git a/resources/views/livewire/grids/room-grid.blade.php b/resources/views/livewire/grids/room-grid.blade.php index e685b41..5c5a67b 100644 --- a/resources/views/livewire/grids/room-grid.blade.php +++ b/resources/views/livewire/grids/room-grid.blade.php @@ -8,7 +8,7 @@ :class="floor === '{{ $fl }}' ? 'bg-blue-500 text-white' : 'bg-white text-gray-700'" x-on:click="floor = '{{ $fl }}'" > - {{ $fl }}F + {{ $fl === 'all' ? '全部' : $fl . '樓' }} @endforeach @@ -30,7 +30,7 @@
@forelse($rooms as $room) -
+
@if($room->type->value === \App\Enums\RoomType::SVR->value) @else