hrank8t
Form Select Loading indicator while filling from API
Forms\Components\DatePicker::make('appointment_date')
->minDate(today())
->native(false)
->format('Y-m-d')
->closeOnDateSelection()
// ->after(now())
->live()
->required(),
Forms\Components\Select::make('appointment_time')
->native(false)
->live()
->hint(new HtmlString(Blade::render('<div wire:loading wire:target="data.appointment_time">Loading... </div>
<x-filament::loading-indicator class="h-5 w-5" wire:loading />')))
->options(function (Get $get) {
if (empty($get('appointment_date'))) {
return [];
} else {
return (new AppointmentService())->getAvailableTimesForDate($get('appointment_date'));
}
})
// ->hidden(fn (Get $get) => !$get('appointment_date'))
->rules([
fn (Get $get): Closure => function (string $attribute, string $value, Closure $fail) use ($get) {
$appointments = (new AppointmentService())->getAvailableTimesForDate($get('appointment_date'));
if (!array_key_exists($value, $appointments)) {
$fail('Sorry, the time slot is not available. Please pick another time slot.');
}
},
])
->required(),
35 replies
select with loading indicator
For those who are looking for the link
https://discord.com/channels/883083792112300104/1246909761551732766/1246915286926491689
Also, I didn't use the wire:target on it to work for me.
6 replies
Widget table actions
You could try something like this
https://filamentphp.com/docs/3.x/actions/modals#customizing-the-modals-heading-description-and-submit-action-label
5 replies