title: How to make different pages of auth() register pages by configuring routes with data defined
body: <p>When I try to open Studentregister page it opens the default register page of auth().</p>
  
  <p>I'm new in Laravel I m having issues with syntaxes...
  I have made only one User class having link with role class.
  (User class is generated through $php artisan auth and foreign key for Role class is added to it.)</p>
  
  <p>Now I want to register different users like student, teacher through studentRegister.blade.php or teacherRegister.blade.php. And I have to fix role_id in student page as 1 and in teacher role id as 2. So what will be the syntax.</p>
  
  <p>created different route for student register and teacher register (web.php) ..</p>
  
  <pre><code>Route::get('student/register','Auth\RegisterController@registerStudent');
  Route::get('teacher/register','Auth\RegisterController@registerTeacher');
  </code></pre>
  
  <p>added role variable and send it to view (Auth/RegisterController.php)</p>
  
  <pre><code>  public function registerStudent()
    { $role_id = 1;
     return view('auth.register',compact('role_id'));
     }
  
    public function registerTeacher()
    { $role_id = 2;
     return view('auth.register',compact('role_id'));
     }
  </code></pre>
  
  <p>setted value of hidden input with "role" name (Auth/Register.Blade.php);</p>
  
  <pre><code>&lt;input id="role" type="hidden" name="role" value="{{$role}}"&gt;
  </code></pre>
  
  <p>change fillable variable in user.php so you can fill role field.</p>
  
  <pre><code>protected $fillable = [ 'name', 'email', 'password',role ];
  </code></pre>
  
  <p>added role to your create function on RegisterController</p>
  
  <pre><code>**(Auth/RegisterController.php)**.
  protected function create(array $data)
  {
      return User::create([
          'name' =&gt; $data['name'],
          'email' =&gt; $data['email'],
          'role' =&gt; $data['role'],
          'password' =&gt; Hash::make($data['password']),
      ]);
  }
  </code></pre>
  
  <p>In StudentRegister.blade.php  I have added this</p>
  
  <pre><code>&lt;input id="role_id" type="hidden" name="role_id" value="1"&gt;
  </code></pre>
  
  <p>In TeacherRegister.blade.php  I have added this</p>
  
  <pre><code>&lt;input id="role_id" type="hidden" name="role_id" value="2"&gt;
  </code></pre>