title: How to validate Laravel 5.4 radio button?
body: <p>How can I validate my radio button in Laravel 5.4?</p>
  <pre><code>&lt;div class=&quot;radio&quot;&gt;
      &lt;label&gt;&lt;input name=&quot;gander&quot; type=&quot;radio&quot; value=&quot;male&quot;&gt;male &lt;/label&gt;
      &lt;label&gt;&lt;input name=&quot;gander&quot; type=&quot;radio&quot; value=&quot;female&quot;&gt;female&lt;/label&gt;
  &lt;/div&gt;
  </code></pre>
  <p><strong>Controller</strong></p>
  <pre><code>/* Validate this form. */
  $this-&gt;validate(request(), [
      'title' =&gt; 'required',
      'body' =&gt; 'required',
      'gander' =&gt; 'in:male,female'
  ]);
  
  $post = new Post;
  $post-&gt;title = $request['title'];
  $post-&gt;body = $request['body'];
  $post-&gt;status = $request['status'];
  $post-&gt;male = $request['male'];
  $post-&gt;female = $request['female'];
  $post-&gt;save();
  
  return redirect('blog');
  </code></pre>
  <p>When I submit the form, I get the following error.</p>
  <blockquote>
  <p>SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'male'
  cannot be null (SQL: insert into <code>posts</code> (<code>title</code>, <code>body</code>, <code>status</code>,
  <code>male</code>, <code>female</code>, <code>updated_at</code>, <code>created_at</code>) values (sdf, sdfsfsd, 0,
  , , 2017-03-01 13:09:54, 2017-03-01 13:09:54))</p>
  </blockquote>
  <p>That means that both of radio buttons' data need for database field. and into my table have these fields: 'title', 'body', 'status', 'male', 'female' 'created_at' &amp; 'updated_at'.</p>
  <p>My problem is how to validate the radio button and how to insert data with the radio button value?</p>