Skip to content

Commit 9a53115

Browse files
committed
Fixed bulk actions using wrong key to select instead of $primaryKey
1 parent 949478c commit 9a53115

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ All notable changes to `laravel-livewire-tables` will be documented in this file
1515

1616
- Modified views to support localization better where necessary (republish views).
1717
- Alphabetize en.json
18+
- Fixed bulk actions using wrong key to select instead of $primaryKey
1819

1920
## [1.3.1] - 2021-04-26
2021

src/Traits/WithBulkActions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function resetBulk(): void
6161
public function selectedRowsQuery(): Builder
6262
{
6363
return (clone $this->rowsQuery())
64-
->unless($this->selectAll, fn ($query) => $query->whereKey($this->selected));
64+
->unless($this->selectAll, fn ($query) => $query->whereIn($this->primaryKey, $this->selected));
6565
}
6666

6767
public function getSelectedRowsQueryProperty(): Builder

0 commit comments

Comments
 (0)