I have these tables:
placesidnameaddress
usersidnameemail
reviewsidplace_iduser_idtitlereviewas_anoniem
The user_id is filled even if as_anoniem is 1.
Now I want to have all the reviews for all the places with the user except for the ones with as_anoniem = 1.
Something like this:
Place::with(['review' => function ($query) {
return $query->with('user')->where('as_anoniem', 1);
}]);
This is not fully correct as it returns only reviews with as_anoniem = 1.
How can I achieve this using eloquent?