Modify query on AttachAction
Hello,
I have this code, allowing to attach more products with BelongsToMany Relation:
It works, but I want to modify the query when saving, to add the inverse record in the DB, how do your do that ?
Tried
$action->getRecordSelect()->saveRelationshipsUsing
, but since it doesnt have ->relationship
chained it doesnt work.
Is there any way to do this, event if its not trough filament?
Thanks!1 Reply
Solved! After many hours and tests, figure it out.
Refrence: https://filamentphp.com/docs/2.x/admin/resources/relation-managers#customizing-the-saving-process
Solution: