Custom AttachAction
Can someone can help?
I have peoples connected thru polymorphic relation MorphToMany.
When I attach person to person, in db I get
The questions is:
Ho to customize AttachAction to get records in db in both directions, so on both persons I get relation with each other?
4 Replies
You might need to define the inverse relationship explicitly. https://filamentphp.com/docs/3.x/panels/resources/relation-managers#unconventional-inverse-relationship-names
It's already there.
Maybe I'm wrong but, I need 2 recordsds in db with one action. Like Person1 -> Person2 and Person2 -> Person1 in case of polymorphic relation MorphToMany.
I realize, that People->Application it's works both directions with one db record, but People->People not.. What can it be wrong?
As long as the relationship is set up correctly it should be fine. Not sure. Sorry.
Probable it's because both People shares the same RelationManager.