title: How to change the api authentication model instead of using default user model in laravel
body: <p>I have two models client and user. For web login i have used user model as super admin. But i want client model to be used for the mobile login through api request.</p>
  
  <p>api.php</p>
  
  <pre><code>Route::group(['middleware' =&gt; 'auth:api'], function() {
      Route::resource('communities', 'communityAPIController');
      Route::resource('communities', 'communityAPIController');
      Route::resource('clients', 'ClientAPIController');
  });
  </code></pre>
  
  <p>Config/auth.php</p>
  
  <pre><code>'guards' =&gt; [
          'web' =&gt; [
              'driver' =&gt; 'session',
              'provider' =&gt; 'users',
          ],
  
          'api' =&gt; [
              'driver' =&gt; 'token',
              'provider' =&gt; 'clients',
              'hash' =&gt; false,
          ],
      ],
  'providers' =&gt; [
          'users' =&gt; [
              'driver' =&gt; 'eloquent',
              'model' =&gt; App\User::class,
          ],
  
           'clients' =&gt; [
               'driver' =&gt; 'eloquent',
               'model' =&gt; \App\Models\Client::class,
           ],
      ],
  
  </code></pre>
  
  <p>i have my Client model like this.</p>
  
  <pre><code>&lt;?php
  
  namespace App\Models;
  
  use Eloquent as Model;
  
  class Client extends Model
  {
  
      public $table = 'clients';
  
  
  
      public $fillable = [
          'name',
          'phone',
          'house_no',
          'type',
          'is_approved',
          'community_id'
      ];
  
      /**
       * The attributes that should be casted to native types.
       *
       * @var array
       */
      protected $casts = [
          'id' =&gt; 'integer',
          'name' =&gt; 'string',
          'phone' =&gt; 'string',
          'house_no' =&gt; 'string',
          'type' =&gt; 'integer',
          'is_approved' =&gt; 'boolean',
          'community_id' =&gt; 'integer'
      ];
  
  
  
  }
  
  </code></pre>
  
  <p>I want to use client model instead of user model for the auth:api. Plz Help me</p>