mutateFormDataUsing not called if no form is present

I am trying to use a CreateAction on a RelationManager to create a new item. There is no form data the user needs to enter. The item should be created automatically using the parent model's ID and auth()->id(). I am trying to use mutateFormDataUsing to inject the user_id into the form data before saving, but it does not seem to be called when there isn't a form modal...
Solution:
Aha, I figured it out. I can use CreateAction::make()->using() and $this->ownerRecord to access the parent record to get the ID needed to create the model.
Jump to solution
2 Replies
josef
josef13mo ago
That makes sense. You could instead just modify the CreateAction to create a new item/model
Solution
Defenestrația
Defenestrația13mo ago
Aha, I figured it out. I can use CreateAction::make()->using() and $this->ownerRecord to access the parent record to get the ID needed to create the model.
Want results from more Discord servers?
Add your server