Don't use joins if you're doing eager loading. You're essentially combining Query Builder commands with Eloquent features, and the two are conflicting. Something like this should get the same thing (skipping the where
constraint for now):
$service_data = Client::with('service_requests.comments')->get();
Note that the nested with()
request will automatically eager load service_requests
and then their comments.
If you need the query on the comments relationship, there are a couple ways to do so, and I don't want to make assumptions about exactly what you're using for (or if it's necessary at all), so I'll skip that for now.