I. B. G. Pramana Adi Putra
I. B. G. Pramana Adi Putra
FFilament
Created by I. B. G. Pramana Adi Putra on 9/22/2023 in #❓┊help
RichEditor is not deferred by default?
Just a quick question, I noticed that whenever I'm typing on the RichEditor (Filament v3) it dispatches HTTP Request. Does it not deferred by default?
3 replies
FFilament
Created by I. B. G. Pramana Adi Putra on 6/23/2023 in #❓┊help
Hide RelationManager card based on certain condition
3 replies
FFilament
Created by I. B. G. Pramana Adi Putra on 5/18/2023 in #❓┊help
DatePicker -> disableDates only when a model is loaded
I've the following use case where Date Picker is disabled when a vehicle is not selected.
->disabled(function (Closure $get) {
return $get('vehicle_id') === null;
})
->disabled(function (Closure $get) {
return $get('vehicle_id') === null;
})
But then later on, when a vehicle is selected, it needs to supply array of dates on disableDates
->disabled(function (Closure $get) {
return $get('vehicle_id') === null;
})->disabledDates(
$this->vehicle->booked_dates
)
->disabled(function (Closure $get) {
return $get('vehicle_id') === null;
})->disabledDates(
$this->vehicle->booked_dates
)
The problem is since we disable it based on vehicle is not selected yet, $this->vehicle is a null and therefore does not return an array of booked dates. Is there a way where I can disabledDates to DatePicker via the following SelectField where choosing the vehicle happens:
Forms\Components\Select::make('vehicle_id')
->helperText('The vehicle that is ordered in this booking')
->relationship('vehicle', 'name', fn (Builder $query) => $query->where('vendor_id', $this->vendor->id))
->preload()
->lazy()
->required()
->disabledOn('edit'),
Forms\Components\Select::make('vehicle_id')
->helperText('The vehicle that is ordered in this booking')
->relationship('vehicle', 'name', fn (Builder $query) => $query->where('vendor_id', $this->vendor->id))
->preload()
->lazy()
->required()
->disabledOn('edit'),
Thanks Pram.dev
2 replies