Custom AttachAction

Can someone can help?
I have peoples connected thru polymorphic relation MorphToMany.
When I attach person to person, in db I get
[
  'person_id' => 1,
  'personable_id' => 2,
  'personable_type' => 'App\Models\Person',
];

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