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
For Relationship fields there is a
saveRelationshipUsing()
method. Otherwise that's the default for the form builder.if you have the relationships in the model, then surely just adding ->model(MyModel) to the form will suffice?
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 π