Laravel API Revisions
Typed schemas for Laravel resources and form requests, evolved through dated API revisions, Stripe-style.
Why Laravel API Revisions
Every change to a response breaks a client built against the old one, and copying resources per version multiplies the code. Declare the latest shape once; each client keeps the revision it was built against.
A revision per client
Picked from a header, the path or the query, with Deprecation and Sunset headers from its #[Meta].
History on the field
Only the fields that changed carry their past: since(), until(), was(). No copied resource, no if per
version.
One request, two revisions
The same controller and the same OrderResource, asked by a client on spring-26 and one on genesis.
spring-26 shape. The quick start
builds it, with the winter-25 revision in between.{
"data": {
"title": "Lamp",
"status": "paid",
"total": 1250,
"lines": [{ "sku": "L-1", "quantity": 2 }],
"customer": { "name": "Ada Lovelace", "email": "ada@example.com" },
"first_name": "Ada",
"last_name": "Lovelace",
"tags": ["gift"]
}
}
{
"data": {
"title": "Lamp",
"paid": true,
"total": 12.5,
"lines": [{ "sku": "L-1", "qty": 2 }],
"customer": { "name": "Ada Lovelace", "email": "ada@example.com" },
"name": "Ada Lovelace"
}
}
Compatibility
Laravel resources and form requests, with a pure-PHP core.
| Version | PHP | Laravel | Status |
|---|---|---|---|
| 1.x | ^8.3 | ^12.46 || ^13.0 | Active |
Start with Laravel API Revisions
Install it, follow the quick start, and see your first result in minutes.