I have a pivot table where the user id and project id are located. I would like to draw all joint projects for 2 different users. How to do it? I am currently downloading all projects for a logged-in user, but I would also like to download projects for a logged-in user and for example a user with id 2. This is what i have now:
$user = User::findOrFail(Auth::user()->id);
$projects = $user->projects;