how to hide a form field conditionally?

I have two Radio Buttons. And want to hide the Select field candidato if no a special radio option is clicked.

Select::make('puesto')
                        ->searchable()
                        ->label( __('Oferta'))
                        ->options(JobOffer::all()
                            ->where('job_offer_open', true)
                            ->sortBy('title')
                            ->pluck('title', 'id'))
                        ->required(),

                    Radio::make('comparison_type')
                        ->label( __('Tipo de comparación'))
                        ->options([
                            '1with1' =>  __('1 Oferta con 1 Candidato'),
                            '1withAll' =>  __('1 Oferta con todos los Candidatos'),
                        ])
                        ->default('1withAll')
                        ->required()
                        ->inline(),

                    Components\ConditionalSelect::make('candidato')
                        ->searchable()
                        ->label( __('Candidato (solamente activos)'))
                        ->options(Applicant::all()
                            ->where('is_active', true)
                            ->sortBy('full_name')
                            ->pluck('full_name', 'id'))
                        ->dependsOn('comparison_type', '1with1')
                        ->required(),
Was this page helpful?