Writing Idempotent API Endpoints: A Practical Guide for Laravel
How to make POST endpoints safe to retry using idempotency keys, without duplicating orders, charges or emails.
Software, AI, databases and the craft of building for the web — explained clearly, with code you can actually use.
How to make POST endpoints safe to retry using idempotency keys, without duplicating orders, charges or emails.
How Sanctum handles both SPA cookie authentication and mobile API tokens, and how to scope tokens with abilities instead of all-or-nothing access.
A practical approach to API versioning in Laravel using resource classes, so you can evolve a response shape without breaking existing clients.
One endpoint was firing 62 queries per request. Here is how eager loading, Redis caching, indexes and rate limiting took it from 840 ms to under 100 ms.