Skip to content
Laracoding Logo
Search
  • Backend
  • Database
  • Frontend
  • Third Party

Category: Database

link to How to Use `with()` to Eager Load Relationship in Laravel

How to Use `with()` to Eager Load Relationship in Laravel

This guide walks you through building an example app that uses `with()` to eager load posts and their related comments and show them in a view

Continue Reading
link to How to Get the Max Value of a Column Using Eloquent

How to Get the Max Value of a Column Using Eloquent

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.

Continue Reading
link to How to Calculate the Average of a Column Using Eloquent

How to Calculate the Average of a Column Using Eloquent

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.

Continue Reading
link to How to Calculate the Sum of Multiple Columns Using Eloquent

How to Calculate the Sum of Multiple Columns Using 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.

Continue Reading
link to How to Calculate the Sum of a Relation Column in Eloquent

How to Calculate the Sum of a Relation Column in Eloquent

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.

Continue Reading
link to How to Order By Relationship Count Using Laravel Eloquent

How to Order By Relationship Count Using Laravel Eloquent

This post shows how to build an app that orders posts by their number of comments. We'll add models, relations, testdata and a page that shows the sorted posts.

Continue Reading
Page 1 Page 2 Page 3 … Page 6 NEXT »

About Us

Laracoding.com is a blog created to help Laravel enthusiasts of all levels to develop their skills. The blog is run by Johan van den Broek, a seasoned Laravel developer who is passionate about sharing his knowledge to make Laravel development more accessible to everyone.

Legal Disclaimer

Laracoding is owned and operated by VisionFlow Media, a company owned by Johan van den Broek, based in Lieren, the Netherlands.

    Laracoding Logo

    Contact

    Veldbrugweg 8
    7364 AE Lieren
    The Netherlands

    +31(6) 12475245
    info@laracoding.com

    More information

    • About Laracoding
    • About Johan van den Broek

    Help

    • Privacy Policy
    • Contact
    • Sitemap

    © 2025 VisionFlow Media
    • LinkedIn
    • Twitter