$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.
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.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community