This release marks a significant milestone in the evolution of the uxmansarwar/response package.
The core class has been completely restructured to support deeper response formatting, debug capabilities, and modern PHP best practices.
✨ What's New
- ✅ Total Refactor with a cleaner singleton lifecycle
- ✅ New
index()method to support nested grouping under a mainkey() - ✅ New
ttl()method to include TTL (Time-to-Live) in API responses - ✅ New
query()method to inject debug query data (e.g., SQL) into the response - ✅ Improved input parser: auto-merges
$_GET,$_POST, and raw JSON - ✅ Cleaner structure using class constants like
RESULT_KEY_TXT,ERROR_KEY_TXT - ✅ Fluent interface – chain methods like
key(),index(),result(),ttl() - ✅ Updated
README.mdwith fresh docs, examples, and badges - ✅ Brand-new
CHANGELOG.mdfor full transparency of all updates
🧼 Developer Notes
- All old behavior from v3.x is still supported, but some parts are now deprecated in favor of new patterns.
- Please update your usages if you're migrating from
v3.0.0.
📦 Installation
composer require uxmansarwar/response🙌 Author
Developed and maintained by Uxman Sarwar
Senior PHP Developer since 2013 | Laravel, REST APIs, Tailwind, Vue.js
Feel free to ⭐ star the repo, report issues, or contribute!