title: Laravel Default Auth with Modals
body: <p>I'm trying to modify laravel's default authentication system by using modal windows and by adding some new fields.
  So, I have a modal window to register a new users which looks like this:</p>
  
  <pre><code>&lt;!-- Modal Register area --&gt;
  &lt;div class="modal fade" id="registerModal" tabindex="-1" role="dialog" aria-labelledby="myRegisterLabel" aria-hidden="true"&gt;
    &lt;div class="modal-dialog" role="document"&gt;
      &lt;div class="modal-content"&gt;
        &lt;form id="formRegister" class="login-form" action="{{ route('register') }}" method="POST"&gt;
  
          {{ csrf_field() }}
  
          &lt;div class="modal-header"&gt;
            &lt;button type="button" class="close" data-dismiss="modal" aria-label="Close"&gt;
              &lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;
            &lt;/button&gt;
            &lt;h4 class="modal-title" id="myRegisterLabel"&gt;Sign Up&lt;/h4&gt;
          &lt;/div&gt;
          &lt;div class="modal-body"&gt;
            &lt;div class="form-group"&gt;
              &lt;label&gt;First Name:&lt;/label&gt;
              &lt;input type="text" name="first_name" placeholder="first name..." value="{{ old('first_name') }}" required autofocus&gt;
            &lt;/div&gt;
            &lt;div class="form-group"&gt;
              &lt;label&gt;Last Name:&lt;/label&gt;
              &lt;input type="text" name="last_name" placeholder="last name..." value="{{ old('last_name') }}" required autofocus&gt;
            &lt;/div&gt;
            &lt;div class="form-group"&gt;
              &lt;label&gt;Email:&lt;/label&gt;
              &lt;input type="email" name="email" placeholder="email..." value="{{ old('email') }}" required&gt;
            &lt;/div&gt;
            &lt;div class="form-group"&gt;
              &lt;label&gt;Password:&lt;/label&gt;
              &lt;input type="password" name="password" required&gt;
            &lt;/div&gt;
            &lt;div class="form-group"&gt;
              &lt;label&gt;Password Confirmation:&lt;/label&gt;
              &lt;input type="password" name="password_confirmation" required&gt;
            &lt;/div&gt;
            &lt;div class="form-group"&gt;
              &lt;button type="submit" class="btn btn-primary"&gt;
                  Register
              &lt;/button&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/form&gt;
        @if(count($errors))
          @foreach ($errors-&gt;all() as $error)
            &lt;div class="alert alert-danger"&gt;
              &lt;p&gt;{{ $error }}&lt;/p&gt;
            &lt;/div&gt;
          @endforeach
        @endif
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;!-- End Modal Register area --&gt;
  </code></pre>
  
  <p>Then I modified the RegisterController validation rules and the create method to include this new fields as well as the migration file. (So, I have the fileds in the database, everything's good there)</p>
  
  <p>RegisterController:</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers\Auth;
  
  use App\User;
  use App\Http\Controllers\Controller;
  use Illuminate\Support\Facades\Validator;
  use Illuminate\Foundation\Auth\RegistersUsers;
  use Illuminate\Http\Request;
  
  class RegisterController extends Controller
  {
      /*
      |--------------------------------------------------------------------------
      | Register Controller
      |--------------------------------------------------------------------------
      |
      | This controller handles the registration of new users as well as their
      | validation and creation. By default this controller uses a trait to
      | provide this functionality without requiring any additional code.
      |
      */
  
      use RegistersUsers;
  
      /**
       * Where to redirect users after registration.
       *
       * @var string
       */
      protected $redirectTo = '/';
  
      /**
       * Create a new controller instance.
       *
       * @return void
       */
      public function __construct()
      {
          $this-&gt;middleware('guest');
      }
  
      /**
       * Get a validator for an incoming registration request.
       *
       * @param  array  $data
       * @return \Illuminate\Contracts\Validation\Validator
       */
      protected function validator(array $data)
      {
          return Validator::make($data, [
              'first_name' =&gt; 'required|max:255',
              'last_name' =&gt; 'required|max:255',
              'email' =&gt; 'required|email|max:255|unique:users',
              'password' =&gt; 'required|min:6|confirmed',
          ]);
      }
  
      /**
       * Create a new user instance after a valid registration.
       *
       * @param  array  $data
       * @return User
       */
      protected function create(array $data)
      {
          return User::create([
              'first_name' =&gt; $data['first_name'],
              'last_name' =&gt; $data['last_name'],
              'email' =&gt; $data['email'],
              'password' =&gt; bcrypt($data['password']),
          ]);
      }
  }
  </code></pre>
  
  <p>In the form as you can see I'm posting this to route('register') but even though I'm not getting any errors when I submit the form and I get redirected to the / the user is not getting saved in the DB.. 
  The thing is, I'm not really sure how this default auth system works..</p>
  
  <p>Thanks for your help!</p>