Released in Laravel 8.57: a shorter way to write whereHas() with a simple condition inside.
1// Before2User::whereHas('posts', function ($query) {3 $query->where('published_at', '>', now());4})->get();5 6// After7User::whereRelation('posts', 'published_at', '>', now())->get();