Currently I've got this eloquent query:
$products = Product::where('is_send', 1)->with(['articles.stock' => function($query) {
$query->where('quantity', '>', 0);
}])->get();
I'm wondering if there is a better way for doing this?
For clarification:
A product hasMany articles
A article hasOne Stock
I need the article_ids
where product is_send = 1
and where the articles of that product have quantity > then 0
.