A relationship property such as $order->customer reads like a field, but its first read runs a query. In a loop that becomes hundreds of round trips, and a page that was fast on ten development rows takes seconds in production. This section measures the problem and fixes it.
The examples use the models of Eloquent Models and Eloquent Relationships against the shop database, grown with recursive CTEs (Recursive CTEs) to 500 customers, 200 products, 2,000 orders with 4,992 line items, and 5,000 reviews. Listings run through php artisan tinker --execute. Timings come from one WSL2 6 machine (PHP 8.5.4, MySQL 9.7.2 524 on the same host); repeat runs varied, sometimes severalfold when the machine was busy, but the query counts never changed.