We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
filament/filament
3.2.122
11.30.0
3.5.12
8.2.18
relation manager table pivot column value missing after add allowDuplicates() for table in relation manager
allowDuplicates()
relation manager table should show pivot column value normally
withPivot()
https://github.com/huiyang/example-app
No response
The text was updated successfully, but these errors were encountered:
currently i add these to my relation manager to solve my issue, i not sure if it have any side effect, but it seem to be working now
protected function hydratePivotRelationForTableRecords(Collection | Paginator | CursorPaginator $records): Collection | Paginator | CursorPaginator { $table = $this->getTable(); $relationship = $table->getRelationship(); if ($table->getRelationship() instanceof BelongsToMany /*&& ! $table->allowsDuplicates()*/) { invade($relationship)->hydratePivotRelation($records->all()); } return $records; }
and
return $table ->allowDuplicates() ->modifyQueryUsing(function($query, $table) { /** @var BelongsToMany $relationship */ $relationship = $table->getRelationship(); $columns = [ $query->getModel()->getTable() . '.*', $relationship->getTable() . '.*', // reversed the select sequence, moved this line to later ]; // if (! $this->allowsDuplicates()) { $columns = [ ...invade($relationship)->aliasedPivotColumns(), ...$columns, ]; // } $query->select($columns); })
Sorry, something went wrong.
No branches or pull requests
Package
filament/filament
Package Version
3.2.122
Laravel Version
11.30.0
Livewire Version
3.5.12
PHP Version
8.2.18
Problem description
relation manager table pivot column value missing after add
allowDuplicates()
for table in relation managerExpected behavior
relation manager table should show pivot column value normally
Steps to reproduce
withPivot()
allowDuplicates()
for relation manager tableReproduction repository (issue will be closed if this is not valid)
https://github.com/huiyang/example-app
Relevant log output
No response
Donate 💰 to fund this issue
The text was updated successfully, but these errors were encountered: