I built this package to bring that pattern to Laravel.
Each old version gets a transformer class with two methods:
- upgradeRequest() — converts old payload to current format before your controller runs - downgradeResponse() — converts response back to old format before it leaves
The middleware chains them automatically across versions. Your controllers never change.
Supports 4 version detection strategies: URL prefix, header, query param, Accept header. Ships with deprecation headers (Sunset, Deprecation), artisan commands for changelog and audit.
composer require jayanta/laravel-api-versionist
jay123anta•1d ago
Happy to discuss the design decisions or any edge cases you can think of.