I have a users table and a profiles table in my database. I would like to have also everything from my profiles table for that user be stored in auth session. Right now my web auth looks like this:
How could I add this to my auth session? I know that a query could be as simple as select * from profiles where user_id = ? but how to add this to auth session?
assuming you have a profile() relationship set up on your model. It's the same as doing User::with('profile'), except it will do it automatically whenever a User is retrieved, so you can access it with Auth::user()->profile, or $request->user()->profile, or whenever you manually retrieve a user.