© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
4 replies
Rome

RelationManager problem with duplicate relationship

I have a N-M relation with RelationManager:
companies
companies
and
items
items
and pivot table
company_item
company_item
. Pivot table has a boolean
obsolete
obsolete
field.

The problem is that I have a ToggleColumn on this obsolete field but when a company has two same items (same
item_id
item_id
but different
pivot_id
pivot_id
, the toggle will work on first ocurrence because is taking
item_id
item_id
and should take
pivot_id
pivot_id
for this.

Instead of taking
pivot_id
pivot_id
(2809 and 5895) is taking the
item_id
item_id
.
Solution
Ok, I solved with
allowDuplicates()
allowDuplicates()
:
return $table
        ->allowDuplicates();
return $table
        ->allowDuplicates();
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

RelationManager select relationship with multiple(), Duplicate entry on update
FilamentFFilament / ❓┊help
2y ago
RelationManager for hasManyThrough relationship
FilamentFFilament / ❓┊help
2y ago
Duplicate Queries in Repeater with Relationship
FilamentFFilament / ❓┊help
2y ago
RelationManager translation for BelongsToMany relationship
FilamentFFilament / ❓┊help
3y ago