title: Laravel 6.x Set auth()->user() By Getting Current User From Axios Call
body: <p>I am working with a team where we have built an application that already has a user login authentication. It stores the current user's ID so that it can be called through calling:</p>
  
  <pre><code>axios.get('/user/getmyid')
      .then((response_ =&gt; {
          user_ID = response.data;
  }
  </code></pre>
  
  <p>The application (built with Vue.JS, Vuex, and Vuetify, not Laravel) routes to my Laravel 6 application, which I have set up in such a way that it requires the use of auth()->id(). I want to be able to retrieve the user_ID and force Laravel's Authentication to Login as the user with that id. We are using the same table for users for both applications, but it isn't called 'users'. Instead, it is called 'User', which I am also having trouble with Laravel 6's Authentication, as Laravel Auth looks specifically for a table called 'users'.</p>
  
  <p>How might I force Auth to 1) login is the user with that ID in Laravel 6, and 2) check against the table 'User' instead of looking for the default 'users' table?</p>
  
  <p>I know that you used to be able to use something similar to the following to work around it in the LoginController():</p>
  
  <pre><code>public function postLogin() {
  $user = User::where('USER_NAME', '=', Input::get('username'))-&gt;firstOrFail();
      Auth::login($user);
  
      return redirect('home');
  }
  </code></pre>
  
  <p>However, this was a solution for Laravel 5.2 and no longer works.</p>
  
  <p>Please help me, I am absolutely lost and no one seems to have found an answer.</p>