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
mushtaqrahim6mo ago
fi
Tieme
Tieme6mo 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
awcodes6mo 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