taxionus / laravel-api-response-builder
Helps building nice, normalized and easy to consume Laravel REST API.
Requires
- php: ^7.2 | ^7.3 | ^8.0
- laravel/framework: >= 6.0
Requires (Dev)
- marcin-orlowski/phpunit-extra-asserts: ^1.2
- orchestra/testbench: ^4.0
- phpunit/php-code-coverage: ^7.0
- phpunit/phpunit: ^8.0
This package is auto-updated.
Last update: 2024-10-18 18:05:35 UTC
README
REST API Response Builder for Laravel
Table of contents
Introduction
ResponseBuilder
is a Laravel package, designed to help you build a nice, normalized and easy to consume
REST API JSON responses.
Benefits
ResponseBuilder
is written for REST API developers by REST API developer and is based on long-lasting experience on both
"sides" of API. It's lightweight, with no dependencies, extensively tested and simple to use yet flexible and powerful,
with support for on-the-fly data conversion, localization support,
automatic message building, chained APIs and (hopefully) exhaustive documentation.
But that's not all! The JSON structure produced by ResponseBuilder
is designed with users of your API in mind, so its
structure is predictible and well-defined which makes dealing with your API using
ResponseBuilder
library a breeze. Simple JSON response, with well-defined and predictable structure, easy to consume
without any hassle or trickery. Your clients will love it. And will love you too :)
You are also covered in a case of emergency, as provided ExceptionHandlerhelper, ensures your API keeps talking JSON (and NOT lame HTML) to its clients even in case of unexpected.
Did I mention, you would also get testing traits that automatically add PHPUnit based unit test to your
whole ResponseBuilder
related code and configuration with just a few lines of code absolutely for free?
Features
- Easy to use,
- Stable and production ready,
- On-the-fly data object conversion,
- API chaining support,
- Localization support,
- Provides traits to help unit test your API code,
- Comes with exception handler helper to ensure your API stays consumable even in case of unexpected,
- No additional dependencies.
License
- Written and copyrighted ©2016-2022 by Marcin Orlowski <mail (#) riham.dev (.) com>
- ResponseBuilder is open-sourced software licensed under the MIT license