Skip to content
Tip by Tab
MI

Mohamed Idris

@hnooz

10 tips merged·laravel, nest, nuxt, react, vue·member since July 2026
github.com/hnooz

Tips by @hnooz

Turn N+1 queries into errors in development with preventLazyLoading()

LARAVEL

Called in a service provider, this throws a LazyLoadingViolationException whenever a relation is accessed without being…

eloquentperformance
@hnooz

Auto-delete stale records with the Prunable trait instead of a custom command

LARAVEL

Add Prunable and a prunable() query, and model:prune (scheduled) deletes matching rows in chunks — no bespoke cleanup c…

eloquentmaintenance
@hnooz

Use whenLoaded() in API resources to avoid firing queries during serialization

LARAVEL

Referencing $this->posts directly in a resource lazy-loads the relation for every model when it wasn't eager-loaded — a…

eloquentapi-resources
@hnooz

Validate and convert date query params at the boundary with ParseDatePipe

NESTJS

NestJS 11 ships ParseDatePipe, which validates an incoming date string and hands your handler a real Date. Parsing date…

nestjs11pipes
@hnooz

Configure a strict global ValidationPipe to strip unknown fields and coerce DTOs

NESTJS

whitelist: true removes any property not declared with a validation decorator — your defense against mass-assignment, s…

nestjsvalidation
@hnooz

Share state across components with useState, never a module-level ref, on SSR

NUXT

On the server a module-level ref is created once and shared by every request, so one user's cart can leak into another'…

nuxt4state
@hnooz

Handle form mutations with built-in pending and error state via useActionState

REACT

useActionState wraps an async action and returns the last result, the action to bind to a <form action>, and a pending…

react19forms
@hnooz

Replace modelValue/update boilerplate with defineModel() for v-model

VUE

defineModel() returns a writable ref wired to the parent's v-model, collapsing the modelValue prop plus update:modelVal…

v-modelcomponents
@hnooz

Cancel stale async work in watchers with onWatcherCleanup()

VUE

Registered inside the watcher callback, onWatcherCleanup runs before the next invocation and on stop. It removes the ma…

watchersasync
@hnooz

Generate hydration-safe unique IDs with useId() for accessibility

VUE

useId() produces IDs that are stable and identical across server render and client hydration, so label/for and aria-des…

ssraccessibility
@hnooz

Want to contribute? Submit a tip →