title: Lumen JWT Auth always return 401 in other route after login success
body: <p>I have lumen + jwt restapi with custom users table (ex : pengguna) with nomor as primary key and tgl_lahir as password..there is no problem with api/login and it's generate a token but when i try with other route such as api/buku, the return always 401 unauthorized although the authorization header contains valid token after login</p>
  <p>my models like</p>
  <pre><code>&lt;?php
  namespace App;
  
  use Illuminate\Auth\Authenticatable;
  use Laravel\Lumen\Auth\Authorizable;
  use Illuminate\Database\Eloquent\Model;
  use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
  use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
  
  use Tymon\JWTAuth\Contracts\JWTSubject;
  
  class User extends Model implements AuthenticatableContract, AuthorizableContract, JWTSubject
  {
      use Authenticatable, Authorizable;
      protected $primaryKey = 'nomor';
      protected $table = 'pengguna';
      public $timestamps = false;
  
      protected $fillable = [
          'nomor','nama','alamat'
      ];
  
      protected $hidden = [
          'tgl_lahir ',
      ];
  
      public function getJWTIdentifier()
      {
          return $this-&gt;getKey();
      }
      
      public function getJWTCustomClaims()
      {
          return [];
      }
  }
  </code></pre>
  <p>my BukuController</p>
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  
  use App\Buku;
  use Illuminate\Http\Request;
  use Illuminate\Support\Facades\DB;
  
  class BukuController extends Controller
  {
  
      public function __construct()
      {
          $this-&gt;middleware('auth');
      }
      
      public function showAllBuku()
      {
          return response()-&gt;json(Buku::all());
      }
  
  }
  </code></pre>
  <p>my routes</p>
  <pre><code>$router-&gt;group(['prefix' =&gt; 'api'], function () use ($router) {
      $router-&gt;post('login', 'AuthController@login');
      $router-&gt;get('buku',  ['uses' =&gt; 'BukuController@showAllBuku']);
  });
  </code></pre>
  <p>config/auth.php</p>
  <pre><code>&lt;?php
  
  return [
      'defaults' =&gt; [
          'guard' =&gt; 'api',
          'passwords' =&gt; 'users',
      ],
  
      'guards' =&gt; [
          'api' =&gt; [
              'driver' =&gt; 'jwt',
              'provider' =&gt; 'users',
          ],
      ],
  
      'providers' =&gt; [
          'users' =&gt; [
              'driver' =&gt; 'eloquent',
              'model' =&gt; \App\User::class
          ]
      ],
  ];
  </code></pre>
  <p>the existing pengguna table don't allowed created ID field like lumen/laravel auth, if i commented code in Middleware\Authenticate like :</p>
  <pre><code>public function handle($request, Closure $next, $guard = null)
      {
          
  //if this block commented is working
          if ($this-&gt;auth-&gt;guard($guard)-&gt;guest()) {
              return response('Unauthorized.', 401);
          }
  
          return $next($request);
      }
  </code></pre>
  <p>it's working..is there another way for my case?thanks for your help</p>