//Added use $request for my needs Event::whereHas('participants', function ($query) use ($request) { return $query->where('IDUser', '=', $request->find_IDUser); })->get();