Support the ongoing development of →
Authentication Security Architecture
Last updated 1 year ago.
$userId = Session::get(Auth::getName()); // user id from session (no query)

can you query the Account table with this user id and subdomain?

small note on the use of Request::server('HTTP_HOST'));, there was a topic about this and someone stated that this can be faked by altering the user's hosts file.

you should look into setting server/environment variables via Apache or Nginx in the vhost config.

Last updated 1 year ago.

what about creating a method in the User model class that joins all the tables you need? or create a helper class that does the same thing so it's available throughout your app - like using it in a filter.

i had a similar question last week where i was trying to extend Auth::User() so that i can have it check my access_types table for page protection. i ended up creating a helper class and it worked out for me.

Last updated 1 year ago.

Sign in to participate in this thread!


Your banner here too?

24creative 24creative Joined 29 Apr 2014


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.

© 2023 - All rights reserved.