Closed HAL0594 closed 1 year ago
I'm trying to make a radio dependent on another one that should only show and be required with one of the above radio options but when trying to assign $field->show()->rules('required'); show the error mesage "Illegal offset type in isset or empty".
Radio::make(__('Duration'), 'duration')->options([ 'none' => __('None'), 'half_day' => __('Half Day'), 'full_day' => __('Full Day'), ])->rules('required'), Radio::make(__('Schedule'), 'schedule') ->hide()->options(['am' => __('am'), 'pm' => __('pm')]) ->dependsOn(['duration'], function (Radio $field, NovaRequest $request, FormData $formData) { if ($formData->duration === "half_day") { $field->show()->rules('required'); } else { $field->hide()->rules('nullable'); } }),
Please try newest release:
https://github.com/Muetze42/nova-radio-field/releases
I'm trying to make a radio dependent on another one that should only show and be required with one of the above radio options but when trying to assign $field->show()->rules('required'); show the error mesage "Illegal offset type in isset or empty".