Support the ongoing development of →
11 months ago
Last updated 3 months ago.


I'd like to help, but need to know first – how the impersonation is implemented?


When admin wants to impersonate user X, I just generate JWT token for user X and that's it. I solved it by using Middleware + Singleton, so on each request I check JWT token and its claims and then I set value in SIngleton and then I use that Singleton to check for the value

If you have any other idea, that would be great


That should work. Assuming you are setting an impersonation flag as part of the payload in JWT (, you can also utilize config() to store it in the configuration.


Sign in to participate in this thread!


Your banner here too?

trbsi trbsi trbsi Joined 3 May 2017


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

Your logo here?

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

© 2022 - All rights reserved.