AxlF
AxlF
FFilament
Created by AxlF on 1/29/2024 in #❓┊help
Is it possible to load select options asynchronous?
Hey, I would like to create some sort of location finder. For that I want to utilize a places api, where I would want a search based on min 3 characters and return the search results. When the user selects a result I want to set other form fields, like postcode or city. Is that possible? I haven't found a Select example with async data... Thanks
6 replies
FFilament
Created by AxlF on 1/22/2024 in #❓┊help
Select first item
Hey, I would like to select the first option item, but somehow it isn't working as expected. UI wise, I get the result when I use ->selectablePlaceholder(false). But the form throws a validation required error on that field.
Forms\Components\Select::make('project_id')
->relationship(
name: 'project',
titleAttribute: 'title',
modifyQueryUsing: fn (Builder $query) => $query->whereHas('users', fn ($q) => $q->where('user_id', auth()->id()))->orderBy('title')
)
->label('Projekt')
->columnSpanFull()
->selectablePlaceholder(false)
->required(),
Forms\Components\Select::make('project_id')
->relationship(
name: 'project',
titleAttribute: 'title',
modifyQueryUsing: fn (Builder $query) => $query->whereHas('users', fn ($q) => $q->where('user_id', auth()->id()))->orderBy('title')
)
->label('Projekt')
->columnSpanFull()
->selectablePlaceholder(false)
->required(),
What am I doing wrong? Bye
5 replies
FFilament
Created by AxlF on 12/6/2023 in #❓┊help
Add Items to Repeater with a Modal
Hey, I'm pretty sure it could work, but I don't get how. Basically I would like to add Items to a Repeater with a form in a Modal instead of an inline form. The modal should ask for postcode and city. The Repeater should show a compound string ("$postcode $city"). I get a modal as input form, but the values are not shown in the repeater
Repeater::make('location')
->schema([
TextInput::make('location'),
])
->addAction(function (Action $action) {
return $action->form([
TextInput::make('postcode')
->required(),
TextInput::make('city')
->required(),
]);
}),
Repeater::make('location')
->schema([
TextInput::make('location'),
])
->addAction(function (Action $action) {
return $action->form([
TextInput::make('postcode')
->required(),
TextInput::make('city')
->required(),
]);
}),
`
5 replies