Eager loading
Also written: with(), load(), eager-load
Loading related rows up front, as in Order::with('items.product')->get(), so a loop doesn't run one query per row. It fixes the N+1 problem.
Also written: with(), load(), eager-load
Loading related rows up front, as in Order::with('items.product')->get(), so a loop doesn't run one query per row. It fixes the N+1 problem.