Filament\Forms\Components\Actions\Action::make('new_product')
// I know there is no setModel() method on action
->setModel(Product::class)
->form([
TextInput::make('product_name')->required(),
Select::make('product_type_id')
->relationship(name: 'type', titleAttribute: 'name')
])
->action(function () {
// When action is executed I want to create new product
});
Filament\Forms\Components\Actions\Action::make('new_product')
// I know there is no setModel() method on action
->setModel(Product::class)
->form([
TextInput::make('product_name')->required(),
Select::make('product_type_id')
->relationship(name: 'type', titleAttribute: 'name')
])
->action(function () {
// When action is executed I want to create new product
});