In below query the awarded
, banned
, featured
and published
parts are being ignored, why?
Query: Show me a list of all featured published books with an author that has been awarded and has not been banned.
$books = myBooks::with('authors')
->whereHas('authors', function ($query) {
$query
->where([
'awarded' => true,
'banned' => false
]);
})
->where([
'featured' => true,
'published' => true
])
->latest()
->get();