Unbounded Query No Limit (ARCH7061)
Esta página aún no está disponible en tu idioma.
Key php.orm.unbounded-query-no-limit · Severity warning · Category orm
Fetching an entire table with no LIMIT/pagination and feeding it into a list or response risks memory blowup as the table grows. Always bound or paginate the result.
Incorrect
Section titled “Incorrect”<?phppublic function index(){ return User::all(); // whole table into memory}Correct
Section titled “Correct”<?phppublic function index(){ return User::paginate(50); // paginated result}Add limit or paginate to queries that feed a list/response.