AttachAction select different relationship?
I have two models with a
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:Jump to 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...
1 Reply
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