You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Detect N+1 queries: dispatch an event on lazy relation load #590
AbstractActiveRecord::retrieveRelation() is the single entry point for lazy loading, so a BeforeLazyRelationLoad event dispatched from EventsTrait would make this detectable by a listener.
Modes: Off (default — nothing is logged or thrown; the only cost is one event dispatch per lazy load), Log (PSR-3 warning carrying relation name, per-request count and trace), Strict (throws LogicException). Scoping per model class via only/except, on top of the existing use EventsTrait opt-in. Default behaviour of existing code is unchanged.
Activity