title: saving dropdown list value in database laravel
body: <p>I am trying to ask gender of the user in registration form through dropdown list but I am unable to get that value in controller.</p>
  
  <p>Here is my code to register.blade.php</p>
  
  <pre><code>&lt;!-- Gender --&gt;
  
  &lt;div class="form-group"&gt;
      &lt;label for="gender" class="col-md-4 control-label"&gt;Gender&lt;/label&gt;
  
      &lt;div class="col-md-6"&gt;
           &lt;select class="form-control" required="required"&gt;
              &lt;option value="male"&gt;Male&lt;/option&gt;
              &lt;option value="female"&gt;Female&lt;/option&gt;
          &lt;/select&gt;
      &lt;/div&gt;
  &lt;/div&gt;  
  </code></pre>
  
  <p>Code of <code>register controller</code></p>
  
  <pre><code>protected function validator(array $data)
  {
      return Validator::make($data, [
          'username' =&gt; 'required|string|max:255',
          'fullname' =&gt; 'required|string|max:255',
          'email' =&gt; 'required|string|email|max:255|unique:users',
          'password' =&gt; 'required|string|min:6|confirmed',
          'dob' =&gt; 'required|date',
          'gender' =&gt; 'required|string',
          // 'gender' =&gt; 'in:male,female'
  
      ]);
  }
  
  /**
   * Create a new user instance after a valid registration.
   *
   * @param  array  $data
   * @return \App\User
   */
  protected function create(array $data)
  {
      dd($data);
      return User::create([
          'username' =&gt; $data['username'],
          'fullname' =&gt; $data['fullname'],
  
          'email' =&gt; $data['email'],
          'password' =&gt; bcrypt($data['password']),
          'dob' =&gt; $data['dob'],
           'gender' =&gt; $data['gender'],
  
      ]);
  }
  </code></pre>
  
  <p><code>user model</code> contains</p>
  
  <pre><code>protected $fillable = [
      'username', 'email', 'password','fullname','dob','gender'
  ];
  </code></pre>
  
  <p>and the output shown when line  'gender' => 'required|string', is commented in validator function of register controller. Nothing happens when this line is uncommented
  <img src="https://i.stack.imgur.com/atVQv.jpg" alt="enter image description here"></p>