© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
1 reply
JonVonWeston

Self Referencing Model and Relationship Manager

Good morning Filamites

I have a table 'Products' and an associated Model - Products - nothing exciting in there

I have a relationship on Products called RelatedProducts which is a hasMany relationship to self::class via a pivot table. A product can have 0 to n related products

The pivot table contains product_id, related_product_id with foreign key constraints etc.

I have created a relation manager on Products referring to the relatedProducts relationship - the table displays well - all good

When I try and attach a product to the relatedProducts relationship via the attach action - I get 'Products::products' doesn't exist which of course it doesn't

Whats the approach for a many to many relationship attachment using the relation managers?

Jon
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

Relationship Manager and Multitenancy
FilamentFFilament / ❓┊help
3y ago
relationship manager
FilamentFFilament / ❓┊help
2y ago
Accessing pivot model relationships in relationship manager
FilamentFFilament / ❓┊help
3y ago
Self-Referencing Nested Resource
FilamentFFilament / ❓┊help
6mo ago