title: How can I connect my additional field to database on Laravel 5.4?
body: <p>I have tried my code on register form.
  When I click the register button, some error shows up.
  Can you help me to solve this?
  <a href="https://i.stack.imgur.com/ZeEUH.jpg" rel="nofollow noreferrer">Register Form Screenshoot</a></p>
  
  <p><a href="https://i.stack.imgur.com/ONb68.jpg" rel="nofollow noreferrer">Error Message Screenshoot</a></p>
  
  <p>migration create_user_table</p>
  
  <pre><code>public function up()
  {
      Schema::create('users', function (Blueprint $table) {
          $table-&gt;increments('id');
          $table-&gt;string('name');
          $table-&gt;string('email')-&gt;unique();
          $table-&gt;string('password');
          $table-&gt;string('phone');
          $table-&gt;rememberToken();
          $table-&gt;timestamps();
      });
  }
  
  /**
   * Reverse the migrations.
   *
   * @return void
   */
  public function down()
  {
      Schema::dropIfExists('users');
  }
  </code></pre>
  
  <p>RegisterController.php</p>
  
  <pre><code>protected function validator(array $data)
  {
      return Validator::make($data, [
          'name'     =&gt; 'required|max:255',
          'username' =&gt; 'sometimes|required|max:255|unique:users',
          'email'    =&gt; 'required|email|max:255|unique:users',
          'password' =&gt; 'required|min:6|confirmed',
          'phone'    =&gt; 'required',
          'terms'    =&gt; 'required',
      ]);
  }
  
  /**
   * Create a new user instance after a valid registration.
   *
   * @param  array  $data
   * @return User
   */
  protected function create(array $data)
  {
      $fields = [
          'name'     =&gt; $data['name'],
          'email'    =&gt; $data['email'],
          'password' =&gt; bcrypt($data['password']),
          'phone'    =&gt; $data['phone'],
      ];
      if (config('auth.providers.users.field','email') === 'username' &amp;&amp; isset($data['username'])) {
          $fields['username'] = $data['username'];
      }
      return User::create($fields);
  }
  </code></pre>
  
  <p>And then on my register form:</p>
  
  <pre><code>&lt;div class="form-group has-feedback"&gt;
     &lt;input type="text" class="form-control" placeholder="Phone Number" name="phone" value="{{ old('phone') }}"/&gt;
     &lt;span class="glyphicon glyphicon-phone form-control-feedback"&gt;&lt;/span&gt;
  &lt;/div&gt;
  </code></pre>