Download the PHP package uxmansarwar/response without Composer
On this page you can find all versions of the php package uxmansarwar/response. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download uxmansarwar/response
More information about uxmansarwar/response
Files in uxmansarwar/response
Package response
Short Description Elegant and lightweight PHP Composer Package for standardized API responses with error, ttl, query and result handling. Package developed by UxmanSarwar a Senior PHP Developer since 2013
License MIT
Homepage https://github.com/uxmansarwar/response
Informations about the package response
๐ฆ Response โ Elegant PHP API Response Handler
๐ Overview
uxmansarwar/response is a powerful yet lightweight PHP package that makes it easy to manage structured API responses. Built with modern PHP practices, it follows a clean singleton pattern and supports result grouping, TTL, debug queries, and more. Ideal for Laravel, Symfony, WordPress, CodeIgniter, or raw PHP projects.
Developed and maintained by Uxman Sarwar, a senior PHP developer since 2013.
โ Features
- Singleton-based fluent API
- Add results, errors, queries, TTL, and input metadata
- Auto-collects
$_GET,$_POST, and raw JSON input - Customizable result/error key groups with
key()andindex() - Get structured responses as JSON or array
- Great for APIs, microservices, and AJAX handlers
โ๏ธ Installation
Via Composer
๐ Quick Start
Initialize
Add Result
Add Error
Grouped Result with Key/Index
Set Time-To-Live (TTL)
Attach Debug Query
Include Input Data
Output as JSON
Output as Array
๐ก Example Use Case: API Endpoint
๐งช Testing
๐ Use Cases
- Laravel: Replace default
response()->json()with a fluent helper - WordPress: Handle AJAX with structured output
- Symfony: Wrap controller responses with grouped structure
- REST APIs: Make consistent error/result formatting
- Microservices: Inject debug info and TTL for downstream caching
๐จโ๐ป About the Author
This package is created by Uxman Sarwar, a full-stack PHP Laravel developer.
- GitHub: @uxmansarwar
- LinkedIn: Uxman Sarwar
- Email: [email protected]
If you found this package useful, consider โญ starring the repo and sharing it with other developers.
๐ SEO & GitHub Keywords
PHP API response library, structured API output PHP, response formatter, Laravel response helper, singleton response PHP, uxmansarwar response composer, REST API output PHP, error handler class PHP, api response json PHP, PHP response class Laravel
๐ฅ Composer Install Reminder
Happy coding! ๐