TIP 07 / 36

Has Many. How Many Exactly?.

In Eloquent hasMany() relationships, you can filter out records that have X amount of children records.

php
// Author -> hasMany(Book::class)
$authors = Author::has('books', '>', 5)->get();