FilamentF
Filament16mo ago
bhattji

How to set date of the DatePicker component?

I wish to set the Maturity date when the Loan Date is entered. I have written the code as below

->reactive()
->afterStateUpdated(function (callable $get, callable $set) {
$scheme = \App\Models\Scheme::find($get('scheme_id'));
if ($scheme){
$set('maturity_date', \Carbon\Carbon::parse($scheme->loan_date)->addDays($scheme->days));
}
})

but it is not working 😦

How to set date of the DatePicker component?
Was this page helpful?