Zum Inhalt springen

Unbounded Query No Limit (ARCH7061)

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

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.

<?php
public function index()
{
return User::all(); // whole table into memory
}
<?php
public function index()
{
return User::paginate(50); // paginated result
}

Add limit or paginate to queries that feed a list/response.