Change relation manager to instead creating a new record, select from an existing record to attach.
I have a
However instead of creating a new record "New Equipment" at the edit page of User, I want it to actually be where it simply updates the selected Equipment
As of now I only have this at the
this leads to simply creation of a new record.
I am a beginner, hoping a clear explanation and guidance for my level. Thank you!
UserResource with a relation manager for equipment.However instead of creating a new record "New Equipment" at the edit page of User, I want it to actually be where it simply updates the selected Equipment
user_id to what user I am currently at the edit page of.As of now I only have this at the
EquipmentsRelationmanager.php wherein it only shows Options that doesn't have a user_id already in this leads to simply creation of a new record.
I am a beginner, hoping a clear explanation and guidance for my level. Thank you!
Solution
I found out that there is an appropriate headeraction for it using "AssosciateAction" at https://filamentphp.com/docs/3.x/panels/resources/relation-managers#associating-and-dissociating-records