title: How to validate checkboxes with Laravel?
body: <p>I am trying to validate a form in Laravel 5.3. The form has checkboxes. I need at least one checkbox to be selected for the form to be vald. This is my form</p>
  
  <p>Here is my form</p>
  
  <pre><code>&lt;div class="form-group {{ $errors-&gt;has('gender') ? 'has-error' : ''}}"&gt;
      &lt;div class="col-md-2"&gt;&lt;/div&gt;
      &lt;div class="col-md-10"&gt;
          &lt;label for="gender_" class="checkbox-inline"&gt;
              {!! Form::checkbox('gender', '', null, ['id' =&gt; 'gender_']) !!}
              {{ trans('blogs.gender_') }}
          &lt;/label&gt;
  
          &lt;label for="gender_1" class="checkbox-inline"&gt;
              {!! Form::checkbox('gender', '1', null, ['id' =&gt; 'gender_1']) !!}
              {{ trans('blogs.gender_1') }}
          &lt;/label&gt;
  
          &lt;label for="gender_2" class="checkbox-inline"&gt;
              {!! Form::checkbox('gender', '2', null, ['id' =&gt; 'gender_2']) !!}
              Female
          &lt;/label&gt;
  
          {!! $errors-&gt;first('gender', '&lt;p class="help-block"&gt;:message&lt;/p&gt;') !!}
      &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div class="form-group {{ $errors-&gt;has('name') ? 'has-error' : ''}}"&gt;
      {!! Form::label('name',trans('blogs.name'),['class' =&gt; 'col-md-2 control-label']) !!}
      &lt;div class="col-md-10"&gt;
          {!! Form::text('name',null, ['class' =&gt; 'form-control']) !!}
          {!! $errors-&gt;first('name', '&lt;p class="help-block"&gt;:message&lt;/p&gt;') !!}
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I am using <code>FormRequest</code> object. Here is my <code>rules()</code> method</p>
  
  <pre><code>/**
   * Get the validation rules that apply to the request.
   *
   * @return array
   */
  public function rules()
  {
      return [
          'gender' =&gt; 'required'
      ];
  }
  </code></pre>
  
  <p>However, the validation fails unless I select every checkbox!</p>
  
  <p>How can I correctly ensure that the validation only fails if no checkboxes is selected?</p>