Versioning and errors in APIs clients actually enjoy
Complete post with author details, sharing, and comments.
Versioning and errors in APIs clients actually enjoy
Conventions for pagination, filtering, and error shapes in Laravel-backed APIs.
Errors are part of the contract
Every non-2xx response should carry a machine-readable code and a human message. Clients branch on codes; humans read messages.
- Use problem+json or a consistent internal schema
- Never leak stack traces to public consumers
- Log correlation IDs server-side
Versioning without drama
URL prefixes or headers are both fine; consistency matters more than dogma. Document defaults and sunset old versions with dates.
Your API is a product; changelogs are marketing.
Favorite posts
Why I structure Laravel apps in layers from day one
2026-05-06
Dockerfiles that keep local and staging honest
2026-05-09
Scope, buffers, and async updates that protect your calendar
2026-05-11
Security habits I repeat on every new repository
2026-05-12
No comments yet.