Support the ongoing development of Laravel.io →
Laravel Authentication

I have a token (generated with Laravel passport) in my header while sending a request. When I want to extract data from the token, I have the following:

$request->user();

But this retrieves the data from the db (because when I change the name value, it givespppps me the new name), which is not a good idea. (since the goal of jwt is extract the data form the token itself and be stateless).

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Vahid Najafi vahidvdn Joined 29 Aug 2020

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.