class Dashboard extends Component implements HasActions, HasForms
{
use InteractsWithActions;
use InteractsWithForms;
public function addToCategoryAction(): Action
{
return CreateAction::make('addToCategory')
->model(Note::class)
->form([
TextInput::make('label')
->required(function (): bool {
// here i would like to use argument "category"
})
->maxLength(255),
])
->mutateFormDataUsing(function (array $data, array $arguments): array {
// here i have access to arguments !
return $data;
});
}
}
class Dashboard extends Component implements HasActions, HasForms
{
use InteractsWithActions;
use InteractsWithForms;
public function addToCategoryAction(): Action
{
return CreateAction::make('addToCategory')
->model(Note::class)
->form([
TextInput::make('label')
->required(function (): bool {
// here i would like to use argument "category"
})
->maxLength(255),
])
->mutateFormDataUsing(function (array $data, array $arguments): array {
// here i have access to arguments !
return $data;
});
}
}