DateTimePicker afterStateUpdated

I want to execute a fn when I change the value of the date time picker

DateTimePicker::make('publish_date')->required()->default(now())->afterStateUpdated(function (\Closure $set, $state) {
    dd('updated');
}),


but the dd is never executed when i change it's value. how to do it properly? (im not using admin panel)
Was this page helpful?