title: Laravel not creating authenticated session for user
body: <p>I am doing user authentication using a custom table. I am able to login successfully as when I do in <code>AuthController.php</code></p>
  
  <pre><code>public function authenticated(Request $request, $user)
  {
      dd($user);
  }
  </code></pre>
  
  <p>I am getting the user details. </p>
  
  <p>But when I access some other route and in the respective controller when I do  </p>
  
  <ul>
  <li><code>dd(Auth::user())</code> returns <code>null</code> </li>
  <li><code>dd(session()-&gt;all())</code> returns <code>_token</code></li>
  <li><code>dd(Auth::check())</code> returns <code>false</code></li>
  </ul>
  
  <p>I am using <code>public_users</code> table for authentication and <code>public_email</code> , <code>public_password</code> fields for doing the authentication so I have changed the <code>App\User.php</code> file as follows:</p>
  
  <pre><code>class User extends Authenticatable
  {
      protected $table = 'public_users';
      protected $primaryKey = 'public_users_id';
      protected $fillable = [
          'public_email',
          'public_password'
      ];
      protected $hidden = [
          'public_password'
      ];
  
      // Override required, Otherwise existing Authentication system will not match credentials
      public function getAuthPassword()
      {
          return $this-&gt;public_password;
      }
  }
  </code></pre>
  
  <p>and in <code>app/Http/Controllers/Auth/AuthController.php</code> I have added the below code</p>
  
  <pre><code>public function loginUsername()
  {
      return property_exists($this, 'username') ? $this-&gt;username : 'public_email';
  }
  
  public function authenticated(Request $request, $user)
  {
      dd($user);
  }
  </code></pre>
  
  <p>and my <code>config/auth.php</code> has</p>
  
  <pre><code>'guards' =&gt; [
      'web' =&gt; [
          'driver' =&gt; 'session',
          'provider' =&gt; 'users',
      ],
  
      'api' =&gt; [
          'driver' =&gt; 'token',
          'provider' =&gt; 'users',
      ],
  ],
  'providers' =&gt; [
      'users' =&gt; [
          'driver' =&gt; 'eloquent',
          'model'  =&gt; App\User::class,
      ]
  ]
  </code></pre>
  
  <p>What am I doing wrong? How could I create user session?</p>
  
  <p>Any help appreciated!</p>