Answer the question
In order to leave comments, you need to log in
How to get current user object in laravel along with eager loading of dependencies?
You need to get the current user object in the controller with eager dependency loading, specifically, the "groups" attached to it, and the "Groups" so that the "Messages" attached to them are also received.
Tried to do like this:
$user = $request->user()->with('groups.messages')->get();
use User;
...
$user = User::with('groups.messagesForSend')->find($request->user()->id);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question