Turn N+1 queries into errors in development with preventLazyLoading()
LARAVELCalled in a service provider, this throws a LazyLoadingViolationException whenever a relation is accessed without being…
eloquentperformance
@hnoozAuto-delete stale records with the Prunable trait instead of a custom command
LARAVELAdd Prunable and a prunable() query, and model:prune (scheduled) deletes matching rows in chunks — no bespoke cleanup c…
eloquentmaintenance
@hnoozUse whenLoaded() in API resources to avoid firing queries during serialization
LARAVELReferencing $this->posts directly in a resource lazy-loads the relation for every model when it wasn't eager-loaded — a…
eloquentapi-resources
@hnoozValidate and convert date query params at the boundary with ParseDatePipe
NESTJSNestJS 11 ships ParseDatePipe, which validates an incoming date string and hands your handler a real Date. Parsing date…
nestjs11pipes
@hnoozConfigure a strict global ValidationPipe to strip unknown fields and coerce DTOs
NESTJSwhitelist: true removes any property not declared with a validation decorator — your defense against mass-assignment, s…
nestjsvalidation
@hnooz