How to validate select2 in laravel


#1

I am trying to validate a field type select2 inside a “wizard” but validation does not work. The first thing I want to do is that by default I select one of the items that contains this select2; and the second thing I want is that, by sending the form and this field is empty, I can not continue but to show me a message or a warning that this field can not be empty (for the “input” and other “select” if it works), in the database this field is already “not null”.

view

<select id="basic" name="basic[]" multiple="multiple" value="OSTEOMUSCULAR" {!! Form::select('examen',$examen, 'required', ['class' => ''])!!}</select>

material-bootstrap-wizard

var $validator = $('.wizard-card form').validate({
          ruboles: {
            basic: {
              required: true,
              minlength: 1,
            }
        },
        errorPlacement: function(error, element) {
            $(element).parent('div').addClass('has-error');
         }
    });

Thanks for your help.