title: how to auto login after successfully registered in laravel 5.4.12?
body: <p>i want to make an auto login after successful registration and redirect to Edit Profile page.. I tried the following code but not working as i want</p>
  
  <pre><code>class RegisterController extends Controller
  {
  
  use RegistersUsers;
  
  protected $redirectTo = '/edit_profile';
  
  
  public function __construct()
  {
      $this-&gt;middleware('guest');
  }
  
  public function createUser(Request $request)
  {
  
  
      $this-&gt;validate($request , [
          'firstName'    =&gt; 'required',
          'lastName'     =&gt; 'required',
          'displayName'  =&gt; 'required',
          'email'        =&gt; 'required |email',
          'password'     =&gt;'required ',
          'gender'       =&gt;'required',
          'day'          =&gt;'required|max:2',
          'month'       =&gt;'required|max:2',
          'year'       =&gt;'required|max:4',
      ]);
      $email=$request-&gt;input('email');
      $password=$request-&gt;input('paasword');
      $dob=$request-&gt;input('day').'-'.$request-&gt;input('month').'-'.$request-&gt;input('year');
      $request-&gt;request-&gt;add(['dob'=&gt;$dob]);
      $request-&gt;request-&gt;add(['password'=&gt;bcrypt($request-&gt;input('password'))]);
      $data = User::create($request-&gt;except(['_token', 'submit', 'day','month','year', 'confirm_password' ,'dayInWeek']));
  
      Auth::login($data);
  
   }
  
  }
  </code></pre>
  
  <p><strong>Routes</strong></p>
  
  <pre><code>    Route::get('/', 'PageController@login');
      Route::get('/home', 'HomeController@index');
  
  
      Route::group( ['middleware' =&gt; 'auth' ], function()
      {
       Route::get('main', 'PageController@main');
  
       Route::get('browse', 'PageController@browse');
  
       Route::get('pickngo', 'PageController@pickngo');
  
       Route::get('edit_profile', 'PageController@profile');
      }
  </code></pre>