1$users = User::whereHas('posts', function($q){
2 $q->where('created_at', '>=', '2015-01-01 00:00:00');
3})->get();
4// only users that have posts from 2015 on forward are returned
5
1 ->whereHas('translation', function ($query) use ($name){
2 $query->where('name', 'like', $name);
3 }, '>=', 10)
4