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

mind-control picture mind-control  ·  3Comments

SwiTool picture SwiTool  ·  3Comments

huiyonghkw picture huiyonghkw  ·  3Comments

duccanh0022 picture duccanh0022  ·  3Comments

parth-vora-7 picture parth-vora-7  ·  4Comments