Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

fakeman2332's avatar

Argument #2 ($guard) must be of type Illuminate\\Contracts\\Auth\\StatefulGuard, Laravel\\Passport\\Guards\\TokenGuard given

I receive Laravel\\Passport\\Http\\Controllers\\AuthorizationController::__construct(): Argument #2 ($guard) must be of type Illuminate\\Contracts\\Auth\\StatefulGuard, Laravel\\Passport\\Guards\\TokenGuard given error when trying access (GET) /authorize route.

config/auth.php:

  'guards' => [
    'web' => [
      'driver' => 'session',
      'provider' => 'users',
    ],
    'api' => [
      'driver' => 'passport',
      'provider' => 'users',
    ],
  ],

config/passport.php:

  'guard' => 'api',
0 likes
3 replies
fakeman2332's avatar

Seems it problem of Laravel 11. I test it on 10, it works

1 like
Beschus's avatar

@fakeman2332 Hi, did you find a solution for Laravel 11? I'm having the same issue and didn't find a solution in the Laravel 11 documentation.

Please or to participate in this conversation.