createOptionForm()
when i create resource from createOptionForm getting error in my form i have hidden field
Select::make('hospital_id')
->hidden(function () use ($hospitalId) {
return $hospitalId !== null;
})
->label(__('Hospital'))
->relationship('hospital', 'name')
->required()
->visible(fn () => Auth::user()->isSuperAdmin()),
when i fill this field its fine
1 Reply
simple solution is set required also dynamic
Also, the hidden is only appelyed if you are not logged in as Super Admin