title: How to change the default table/model (User) for JWT authentication in Laravel and Dontrine?
body: <p>I am working on a project that was built on <code>Laravel 5.4.24</code> and integrated with <code>Symfony</code> component and <code>Doctrine</code>. I need to authenticate staffs on request from <strong><code>site_staffs</code></strong> table <strong><code>(SiteStaff model)</code></strong> and return the token. 
  <strong><code>site_staffs</code></strong> table has these columns: <code>(id,</code><strong><code>site_id</code></strong><code>, code, number,..)</code>. Some columns have different names in the <code>SiteStaff entity</code> <code>(id,</code><strong><code>site</code></strong><code>, code,..)</code>.
  There is another table for <strong><code>users</code></strong> and I have no issue to authenticate users and return the token. (In my case, I don't need to authenticate users and I just did that for testing).
  The issue is when I try to change the default settings of JWT to authenticate staffs from <strong><code>site_staffs</code></strong> table as below, I get an error message (see down the page):</p>
  
  <p>config/jwt.php:</p>
  
  <pre><code>//'user' =&gt; 'App\User',
  'user' =&gt; 'App\Entities\SiteStaff',
  </code></pre>
  
  <p>config/auth.php:</p>
  
  <pre><code>    'guards' =&gt; [
          'web' =&gt; [
              'driver' =&gt; 'session',
              'provider' =&gt; 'users',
       ],
  
      'api_token' =&gt; [
         'driver' =&gt; 'api_token',
         'provider' =&gt; 'users',
       ],
  
      //'api' =&gt; [
          //'driver' =&gt; 'jwt',
          //'provider' =&gt; 'users',
      //],        
     ],
  
      'providers' =&gt; [
          'users' =&gt; [
              'driver' =&gt; 'doctrine',
               //'model' =&gt; App\Entities\User::class,
              'model' =&gt; App\Entities\SiteStaff::class,            
          ],
  </code></pre>
  
  <p>pi/SiteStaffController:</p>
  
  <p>I am passing the credentials to JWT as follow:</p>
  
  <pre><code>$credentials = 
      [
          'site'     =&gt;  $bpId,
          'code'  =&gt;  $lanyard_code
      ];   
  
  if(! $token = JWTAuth::attempt($credentials)){
        return response()-&gt;json(['error' =&gt; ['messages' =&gt; 
        ['Invalid credentials'] ]
     ], IlluminateResponse::HTTP_UNAUTHORIZED);
   }else{
      dd($token);
   }   
  </code></pre>
  
  <p>Here is the error I get:</p>
  
  <pre><code>Type error: Argument 1 passed to 
  
  Tymon\JWTAuth\Providers\User\EloquentUserAdapter::__construct() must be an 
  instance of Illuminate\Database\Eloquent\Model, instance of 
  App\Entities\SiteStaff given, called in /vagrant/vendor/tymon/jwt-
  auth/src/Providers/JWTAuthServiceProvider.php on line 126
  </code></pre>
  
  <p>I tried many different ways and solutions but non of them worked for me. I appreciate if you could let me know what is wrong and what am I missing?
  Your help is highly appreciated.</p>