Skip to content

Commit

Permalink
Select table records by pivot if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
johanmolen authored Dec 5, 2024
1 parent f3787f1 commit 2cfe1e4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/tables/src/Concerns/HasBulkActions.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,10 +349,9 @@ public function getSelectedTableRecords(bool $shouldFetchSelectedRecords = true)

$table = $this->getTable();

if (
$shouldFetchSelectedRecords ||
(! ($table->getRelationship() instanceof BelongsToMany && $table->allowsDuplicates()))
) {
$usePivotQuery = $table->getRelationship() instanceof BelongsToMany && $table->allowsDuplicates();

if (! $usePivotQuery) {
$query = $table->getQuery()->whereKey($this->selectedTableRecords);
$this->applySortingToTableQuery($query);

Expand Down

0 comments on commit 2cfe1e4

Please sign in to comment.