Support the ongoing development of Laravel.io →
Authentication Security Architecture
Last updated 2 years ago.
0
$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 2 years ago.
0

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 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

24creative 24creative Joined 29 Apr 2014

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.

© 2024 Laravel.io - All rights reserved.