Skip to content

Commit f607fbd

Browse files
committed
Simplify query cloning logic in HasBoardRecords for improved clarity
1 parent 659b18f commit f607fbd

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/Concerns/HasBoardRecords.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,7 @@ public function getBoardRecords(string $columnId): Collection
7878
// Apply table filters using Filament's native system
7979
if ($livewire->getTable()->isFilterable()) {
8080
$baseQuery = $livewire->getFilteredTableQuery();
81-
if ($baseQuery) {
82-
$queryClone = (clone $baseQuery)->where($statusField, $columnId);
83-
}
81+
$queryClone = (clone $baseQuery)->where($statusField, $columnId);
8482
}
8583

8684
$positionField = $this->getPositionIdentifierAttribute();
@@ -109,11 +107,8 @@ public function getBoardRecordCount(string $columnId): int
109107
// Apply table filters using Filament's native system
110108
$livewire = $this->getLivewire();
111109
if ($livewire->getTable()->isFilterable()) {
112-
// Use Filament's native filtered query
113110
$baseQuery = $livewire->getFilteredTableQuery();
114-
if ($baseQuery) {
115-
$queryClone = (clone $baseQuery)->where($statusField, $columnId);
116-
}
111+
$queryClone = (clone $baseQuery)->where($statusField, $columnId);
117112
}
118113

119114
return $queryClone->count();

0 commit comments

Comments
 (0)