codecasts / laravel-jwt

Dead simple, plug and play JWT API Authentication for Laravel (5.4+)
MIT License
234 stars 27 forks source link

Method issue() does not exist. #33

Closed csonti4000 closed 6 years ago

csonti4000 commented 6 years ago

I follow the instructions step by step, but throw Exception Method issue() does not exist. Any Idea what is wrong?

My code:

function login(Guard $auth){ $user2 = User::find(1); $auth->login($user2); $token = $auth->issue(); return $token; }

hernandev commented 6 years ago

This happens when the Guard is not correctly set.

You must enable the jwt driver on your config/auth.php.

Make sure to folow the instructions, if the problem actually persists, you may:

For now, I'm closing this one, feel free to reopen with more details, if that's the case.

Thank you.