Framework activity
See which Eloquent records moved through the request
Group model retrievals and lifecycle writes by class and source, then connect repeated records and changed attributes to the queries and code that produced them.
Start with the model groups
The Models section groups activity by model class, connection, table, source, and logical operation. This keeps a busy lifecycle readable without hiding the underlying retained records.
- Use retrieval counts to spot models loaded more often than the page needs.
- Use record identifiers to see whether repetition affects the same rows or many different rows.
- Use source groups to separate model work started from different controllers, resources, jobs, or views.
- Use logical write operations instead of counting every Eloquent lifecycle event as a separate write.
Investigate retrievals
A large retrieval count is not automatically a problem. Check how many unique records were loaded, whether the same record appears repeatedly, and which source caused each group.
Repeated retrievals often point to relationship access in a loop, duplicated resource work, accessors that load data, or several layers requesting the same model. Confirm the matching query pattern before deciding whether eager loading, batching, or reuse is appropriate.
Review logical writes and changed attributes
Created, updated, deleted, restored, trashed, and force-deleted model activity is folded into logical operations. Open one operation to inspect the record key, changed attributes, lifecycle events, timing, source, and related database work.
Use repetition as a lead
-
Choose the repeated model group
Confirm the class, table, operation, record count, and source group. -
Compare record identifiers
Decide whether one record is touched several times or a collection triggers one operation per record. -
Open the source and related query
Follow the retained application location into the loop, relationship, resource, observer, or helper that controls it. -
Repeat the same request
Confirm the model and query shape changed without removing needed lifecycle behavior.
Connect models to database queries
Model evidence explains what Eloquent did; query evidence explains what the database executed. Use source-based correlation and related query counts to move between the two views without assuming every query maps to one model event.
When retrievals grow with a collection, open Queries to inspect normalized SQL, changing bindings, and likely N+1 findings.
Next step
Inspect the SQL behind model work
Use repeated query shapes, bindings, duration, EXPLAIN, and application call sites to confirm the database cause.
Open the query guide