You can use Eloquent has()
function to query relationships even two layers deep!
// Author -> hasMany(Book::class);// Book -> hasMany(Rating::class);$authors = Author::has('books.ratings')->get();
You can use Eloquent has()
function to query relationships even two layers deep!
// Author -> hasMany(Book::class);// Book -> hasMany(Rating::class);$authors = Author::has('books.ratings')->get();