Select::make('category_id')
->relationship('category', 'name')
->preload()
->searchable()
>live()
->afterStateUpdated(function (?string $state) {
// If the selected category_id select field value has_close_data is true, then we do not hide the close_date field; if it is false, then we hide the close_date field.
})
->required(),
DatePicker::make('close_date'),
Select::make('category_id')
->relationship('category', 'name')
->preload()
->searchable()
>live()
->afterStateUpdated(function (?string $state) {
// If the selected category_id select field value has_close_data is true, then we do not hide the close_date field; if it is false, then we hide the close_date field.
})
->required(),
DatePicker::make('close_date'),