In this post we'll create an application where users browse movies and their average rating. We'll use withAvg to calculate it and a blade view to show results.
Series: Aggregating With Laravel Eloquent
In this post we'll make a simple application that shows how to calculate the sum of 2 columns, by printing online_sales + in_store_sales of a specific product.
In this post you'll use withSum to aggregate and sum a related table column. We'll make migrations, models, insert data and calculate total sales per product.
In this tutorial we'll create a scores table with player and their scores. We'll calculate the max score in a controller and show the winner using a blade view.