Should I use chunkById instead of chunk when the same job also updates the rows it iterates?
Use `chunkById()` when there is real per-row work and never touch the cursor column; if you only update a column, switch to one set-based `UPDATE`.
Tag
Relations and queries with Laravel Eloquent: eager loading, N+1 traps and attribute casts. Questions under this tag, answered directly.
3 answered questions carry this tag.
Use `chunkById()` when there is real per-row work and never touch the cursor column; if you only update a column, switch to one set-based `UPDATE`.
Integer cents in the DB, an immutable `Money` on the model: put the mapping in one `CastsAttributes` class and keep currency as a second column there.
Run it fully strict and throwing in local and CI; in production keep it on but wire handleLazyLoadingViolationUsing to log without failing the request.