Skip to main content

What it flags

The standalone loadwise perf polyglot command detects a static Eloquent model lookup inside foreach where the lookup takes the current item as its key. The model must visibly extend the Eloquent base class, including through an aliased import.

How to review or fix

Consider a batched query for independent keys after checking ordering, missing results and authorization or visibility filters.