Код: Выделить всё
protected function handleRecordCreation(array $data): Model
{
// Here I want to access to the data coming from the main form AND from the form in the modal ('how_many' field)
// $data DOES NOT contains "how_many"
}
protected function getCreateFormAction(): \Filament\Actions\Action
{
return \Filament\Actions\Action::make('create')
->label(__('filament-panels::resources/pages/create-record.form.actions.create.label'))
->requiresConfirmation()
->form([
Select::make('how_many')
->label(__('site.howMany'))
->options(collect(range(1, 20))->mapWithKeys(fn($number) => [$number => $number])),
])
->modalDescription('Desc')
->action(function (CreateAnimal $livewire, array $data) {
$livewire->data = array_merge($livewire->data, $data); // HERE $livewire->data contains "how_many"
$livewire->create();
})
->keyBindings(['mod+s']);
}
Как я могу это сделать? /p>
Спасибо за вашу помощь. < /p>
Подробнее здесь: https://stackoverflow.com/questions/794 ... ing-record