-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
Hi!
Thanks for this great add-on.
I wonder if it is possible to use additional data from the modal form (https://filamentphp.com/docs/3.x/actions/modals#modal-forms)
to pass data to content?
I try as below but there is no data in $data
Html2MediaAction::make('print')->label('Drukuj')->icon('heroicon-o-printer')
->content(
function ($record, $data) {
return view('employee', [
'record' => $record,
'template_id' => $data['template_id'] ?? null,
'date_from' => $data['date_from'] ?? null,
'date_to' => $data['date_to'] ?? null
]);
}
)
->form([
Select::make('template_id')->selectablePlaceholder(false)
->label('Szablon')
->live()
->options(
function () {
return Template::where('type', "Pracownik")->get()->pluck('name', 'id');
}
)
,
\Filament\Forms\Components\Fieldset::make('Okres')->schema([
\Filament\Forms\Components\DatePicker::make('date_from')->default(now())
->label('Data od'),
\Filament\Forms\Components\DatePicker::make('date_to')->default(now())
->label('Data do')
])->hidden(fn(Get $get) => $get('template_id') != 2),
]),
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels