AttachAction select different relationship?
I have two models with a
I also have an
I have a relationship setup on the
It seems the
BelongsToMany relationship: Account and AccountCollection.I also have an
AccountsRelationManager on an AccountCollectionResource.I have a relationship setup on the
Account model called collections() rather than the Laravel naming convention of accountCollections(). When I try to attach an account on the relation manager, I get the following error:Call to undefined method App\Models\Crm\Account::accountCollections()
It seems the
AttachAction is looking for a relationship that doesn't exist. How can I fix this without renaming my relationship? Is there an option on the AttachAction I can use?Solution
Never mind, found it in the documentation. Just needed better keywords for the search 
https://filamentphp.com/docs/3.x/panels/resources/relation-managers#unconventional-inverse-relationship-names
https://filamentphp.com/docs/3.x/panels/resources/relation-managers#unconventional-inverse-relationship-names