protected function addRequiredForSecretField(ValidatorResolver $resolver, $field, $hidden)
    {
        $resolver->sometimes($field, 'required', function ($input) use ($hidden) {
            return $input->$hidden == 'yes';
        });
    }
protected function addRequiredForSecretField(ValidatorResolver $resolver, $field, $hidden)
    {
        $resolver->sometimes($field, 'required', function ($input) use ($hidden) {
            return $input->$hidden == 'yes';
        });
    }
protected function addRequiredForSecretField ( ValidatorResolver $ resolver , $ field , $ hidden ) { $ resolver -> sometimes ( $ field , 'required' , function ( $ input ) use ( $ hidden ) { return $ input -> $ hidden == 'yes' ; } ) ; }
Add required for secret or password field.

@param  \Illuminate\Contracts\Validation\Validator  $resolver
@param  string  $field
@param  string  $hidden

@return void
Add required for secret or password field .