how to combine multiple resources in one form

Suppose in one form one section for user creation while the other for post creation as both have their own table
3 Replies
mushtaqrahim
mushtaqrahimOP11mo ago
fi
Tieme
Tieme11mo ago
Resources are for one model. However you can create a header action with form te create a form for a other model. I dont see the use for this on a resource but it is possible.
Tables\Actions\CreateAction::make()
->model(Unit::class)
->form($this->formComponents())
->modalFooterActionsAlignment(Alignment::End),
Tables\Actions\CreateAction::make()
->model(Unit::class)
->form($this->formComponents())
->modalFooterActionsAlignment(Alignment::End),
If you are looking for something like the image, you have to create a custom page.
No description
awcodes
awcodes11mo ago
If resource A has a relationship to resource B you can use a Select with a createOptionForm() to create new records on the fly. Not sure if that’s what you’re trying to do or not. https://filamentphp.com/docs/3.x/forms/fields/select#creating-a-new-option-in-a-modal
Want results from more Discord servers?
Add your server