
Why $user->delete() is not a right-to-erasure implementation
The request arrives in support: delete everything you hold on me. Someone forwards it to a developer,...
Tag archive

The request arrives in support: delete everything you hold on me. Someone forwards it to a developer,...
Finding and Fixing the Eloquent N+1 Problem You deploy a feature, and within days the DBA...
Once an agent can read a model, it wants the neighbours. Show me the ticket, and its comments, and...
Sua tela demora 8 segundos e você jura que o código tá certo. O culpado é o N+1 query. Veja como achar e matar com uma linha no Eloquent.
Most Laravel models have a few fields nobody types in. A total summed from line items, a slug, a...

Sometimes you need tags on a model. The usual answer is a tags table, a pivot, a slug and a...
O first() esconde bugs de dados duplicados. Conheça o sole() do Eloquent, que retorna um registro só e reclama quando aparece mais de um.

Flexible API filters often look elegant at first and turn into maintenance debt later. This post compares scopes, query objects, packages, JSON filters, and relationship filters with a bias toward what stays understandable as the API grows.

Find any Eloquent method instantly. 27 groups, hundreds of methods, one search.
Deletou um registro em produção e o cliente pediu de volta? Soft Deletes marca como apagado sem sumir do banco. Veja como usar (e as pegadinhas).
Ainda faz json_decode na mão no seu model? O Eloquent tem uma penca de casts prontos que quase ninguém usa. Bora conhecer os melhores.

with('commentable') looks eager. Then the nested relations fall back to lazy queries. Here's why morphTo needs morphWith, with query counts.