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

pdellepiane's avatar

Laravel + JWT

Hello, I'm trying to learn how JWT works with Laravel. I'm using the following library: https://github.com/tymondesigns/jwt-auth.

This is what I understood so far:

  1. The user login. By loggin in, the application returns a token. This token contains the user credencials encrypted.

  2. Whenever the user requests for information, the requests needs to have that given token in the header like: Authorization: Bearer {token}.

Now, thats the easy part, but there are a few things I get pretty confusing. For example:

  1. What if the token expires? The user needs to write its credentials again?

  2. How do I retrieve the information sent?

Thanks in advance!

0 likes
0 replies

Please or to participate in this conversation.