Support the ongoing development of Laravel.io →
Authentication Requests Session

Hey! I have just started to create a Laravel application featuring websockets. I have managed to create a artisan command for the websocket server but I just realized that I have no way of getting the logged in user that is connecting to the server.

Normally you just do Auth::user() or Sentry::getUser() if you're using Sentry. In this case Auth::user wouldn't return anything. Do you have any idea of how to retrieve the user from the connection that's issued to the server?

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Marwzoor marwzoor Joined 8 Feb 2015

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.