Package Versions:
- PHP 8.2.12
- Laravel 10.28.0
- Filamentphp v3
I would like to make the copy_permis field required or not depending on the specialty selected.
I have two models Candidat(id,name,specialty_id) and Specialty(id,name,is_required ). NB: is_required : is boolean
Forms\Components\Select::make('specialty_id')
->required()
->live()
->searchable()->preload()
->relationship('specialty','name'),
Forms\Components\FileUpload::make('copie_permis')
->directory('permis_files')
->openable()
->downloadable()
->image()
->imageEditor()
->required(fn (Get $get): bool => ($get('specialty_id.is_required') == true)),
I expect to check the value of is_required to decide if it's required or not.