Passport: requestGuard::attempt does not exist in login

Created on 13 Mar 2018  路  3Comments  路  Source: laravel/passport

why is it always, shows this error message?
"Method Illuminate\Auth\RequestGuard::attempt does not exist."

Please help. :/

Most helpful comment

I have same issue, looks like "api" guard not contain attempt method. Changing default guard to "web" fixed my problem.

config/auth.php:

    'defaults' => [
        'guard' => 'web',
        'passwords' => 'users',
    ],

Also you can define guard in your controller with Auth::guard('web')->attempt($credentials)

All 3 comments

I have same issue, looks like "api" guard not contain attempt method. Changing default guard to "web" fixed my problem.

config/auth.php:

    'defaults' => [
        'guard' => 'web',
        'passwords' => 'users',
    ],

Also you can define guard in your controller with Auth::guard('web')->attempt($credentials)

@hamra

I have same issue, looks like "api" guard not contain attempt method. Changing default guard to "web" fixed my problem.

config/auth.php:

    'defaults' => [
        'guard' => 'web',
        'passwords' => 'users',
    ],

Also you can define guard in your controller with Auth::guard('web')->attempt($credentials)

But it returns boolean, not the api token

Hi there,

Looks like this is a question which can be asked on a support channel. Please only use this issue tracker for reporting bugs or problems. If you have a question on how to use functionality provided by this repo you can try one of the following channels:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nilsbrychzy picture nilsbrychzy  路  52Comments

Joshgallagher picture Joshgallagher  路  91Comments

billriess picture billriess  路  29Comments

ahinkle picture ahinkle  路  35Comments

adaojunior picture adaojunior  路  52Comments