bennett
bennett
FFilament
Created by bennett on 1/30/2024 in #❓┊help
Grouped Actions don't engage modal.
No description
4 replies
FFilament
Created by bennett on 1/19/2024 in #❓┊help
How do you define the layout for a header action form?
I have a simple section, shown below. I've tried using Grid and Section within the ->form() definition, but I get a type error that the ->form() argument must be of type Filament\Forms\Components\Component
->headerActions([
Action::make('Edit Address')
->label('Edit Address')
->outlined(true)
->color('primary-blue')
->size(ActionSize::ExtraSmall)
->icon('heroicon-o-pencil')
->modalDescription('Update contact address.')
->fillForm(fn ($record): array => [
'street_one' => $record->street_one,
'street_two' => $record->street_two,
'city' => $record->city,
'state' => $record->state,
'zip' => $record->zip,
])
->form([
TextInput::make('street_one')
->label('Street One'),
TextInput::make('street_two')
->label('Street Two'),
TextInput::make('city')
->label('City'),
Select::make('state')
->label('State')
->options(State::pluck('abbreviation', 'name')->toArray())
->searchable(),
TextInput::make('zip')
->label('Zip'),

])
->action(function ($record, $data) {
ray($record, $data);
})
->headerActions([
Action::make('Edit Address')
->label('Edit Address')
->outlined(true)
->color('primary-blue')
->size(ActionSize::ExtraSmall)
->icon('heroicon-o-pencil')
->modalDescription('Update contact address.')
->fillForm(fn ($record): array => [
'street_one' => $record->street_one,
'street_two' => $record->street_two,
'city' => $record->city,
'state' => $record->state,
'zip' => $record->zip,
])
->form([
TextInput::make('street_one')
->label('Street One'),
TextInput::make('street_two')
->label('Street Two'),
TextInput::make('city')
->label('City'),
Select::make('state')
->label('State')
->options(State::pluck('abbreviation', 'name')->toArray())
->searchable(),
TextInput::make('zip')
->label('Zip'),

])
->action(function ($record, $data) {
ray($record, $data);
})
7 replies
FFilament
Created by bennett on 1/7/2024 in #❓┊help
Modal won't display from Infolist
I have an Infolist I'm rendering in a Livewire component. I have this action defined:
TextEntry::make('name')
->icon('heroicon-m-user')
->hintAction(
Action::make('copyName')
->icon('heroicon-m-clipboard')
->requiresConfirmation()
->action(function ($record) {
ray('hi');
}),
TextEntry::make('name')
->icon('heroicon-m-user')
->hintAction(
Action::make('copyName')
->icon('heroicon-m-clipboard')
->requiresConfirmation()
->action(function ($record) {
ray('hi');
}),
Infolist renders fine, no errors in the console or PHP-side. I'm not sure what I'm doing wrong. I click the button and no modal appears, and the action isn't run. What am I missing here?
10 replies
FFilament
Created by bennett on 8/26/2023 in #❓┊help
Image Processing
Is it possible to programmatically access uploaded images for processing? Ideally I'd like to run Spatie's image optimizer on any images uploaded before they are saved through the FileUpload field type and the files uploaded in the RichEditor field type. I realize I can run it against files already uploaded to the disks, but it would be nice to process the images before they are saved to disk.
9 replies
FFilament
Created by bennett on 8/7/2023 in #❓┊help
Select Form Field Limits 50 Options Visible
When using the Select form-field, I'm populating the options() method like this:
Select::make('promotion')
->options(function(){
$promos = PromotionMeta::orderBy('promotion_desc')
->pluck('promotion_desc', 'promotion')
->toArray();
return $promos;
})
->searchable()
->required()
->reactive(),
Select::make('promotion')
->options(function(){
$promos = PromotionMeta::orderBy('promotion_desc')
->pluck('promotion_desc', 'promotion')
->toArray();
return $promos;
})
->searchable()
->required()
->reactive(),
My problem is: only 50 results are visible in the dropdown at a time. Can this be changed? Yes, I realize it's searchable but users may not know what to search. I'd like to show all options.
4 replies