Skip to content

Commit

Permalink
Table: fix selectable for pagination (#186)
Browse files Browse the repository at this point in the history
Fix `select all` when `rows` is paginated.
  • Loading branch information
robsontenorio authored Dec 5, 2023
1 parent d5c4a60 commit e5155ba
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/View/Components/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ public function __construct(
// Get all ids for selectable and expandable features
public function getAllIds(): array
{
// Pagination
if ($this->rows instanceof ArrayAccess) {
return $this->rows->pluck($this->selectableKey)->all();
}

return collect($this->rows)->pluck($this->selectableKey)->all();
}

Expand Down

0 comments on commit e5155ba

Please sign in to comment.