F
Filamentβ€’7mo ago
Patrick

Trigger form + relationship save method in custom action?

How can I save the form and all relationships in my custom action ? I want to manually call what "Save changes" button does.
3 Replies
Dennis Koch
Dennis Kochβ€’7mo ago
For Relationship fields there is a saveRelationshipUsing() method. Otherwise that's the default for the form builder.
toeknee
toekneeβ€’7mo ago
if you have the relationships in the model, then surely just adding ->model(MyModel) to the form will suffice?
Patrick
PatrickOPβ€’7mo ago
Thanks for your replies and help! It worked with $form->saveRelationships() in my custom action. I was missing to use($form) in my custom action and so had no access to saveRelationships() Thanks πŸ™‚
Want results from more Discord servers?
Add your server