DEV Community

Discussion on: Build a JWT Authenticated API with Lumen(v5.8)

Collapse
 
cleathley profile image
Chris Leathley • Edited

you might want to also add

use Illuminate\Support\Facades\Auth;

when you add respondWithToken to app/Http/Controllers/Controller.php (Lumin 6+)

Collapse
 
sayajin101 profile image
Syns

This saved my life ty

Collapse
 
kbzone profile image
Cabello, Hector Guillermo

This is key.

I was followed step by step your tutorial, writing the code by myself (i mean, without clone your github project) and without this line (thanks @cleathley ) an error appears.

I think you should edit your post and add that line after you explain this:
«Add a global respondWithToken method to Controller class»

Anyway, great tutorial. It help me a lot!!

Collapse
 
ndiecodes profile image
Ndifreke Friday • Edited

I'm glad it helped 👍

I will update the post, so new readers don't run into this same error.

Collapse
 
ndiecodes profile image
Ndifreke Friday

Thanks For this, I will update the tutorial to help people not encounter this error in the future.