Is it able to use saveRelationships() in action button?
I have a custom page listed created user. I put an action with following info to create a new user with related branches:
Action form()
Action action()
Solution:Jump to solution
Thank you, @Dan Harrin. I forgot about
using()
in the CreateAction. So, for anyone facing the same situation, this is the correct code (of course, you will modify it according to your code):
```php
Actions\CreateAction::make()
->using(function ($data) {...3 Replies
Models:
RestaurantUser which
belongsTo
User and belongsToMany
BranchHave a look at how CreateAction works
Solution
Thank you, @Dan Harrin. I forgot about
using()
in the CreateAction. So, for anyone facing the same situation, this is the correct code (of course, you will modify it according to your code):
Docs: https://filamentphp.com/docs/3.x/actions/prebuilt-actions/create#customizing-the-creation-process