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
Was this page helpful?