Hi Daniel,
As far as I can tell there is also a products table. Please refer to the documentation.
$products = Product::withCount('solderings')->get();
foreach($products as $product)
echo $product->solderings_count;
I can recommend you to have the Product model as well, otherwise you need to group by product_id.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community