marcin-orlowski / laravel-api-response-builder
Helps building nice, normalized and easy to consume Laravel REST API.
Installs: 360 891
Dependents: 1
Suggesters: 0
Security: 0
Stars: 771
Watchers: 16
Forks: 84
Open Issues: 1
Requires
- php: ^8.2|^8.3|^8.4
- laravel/framework: ^12.0
Requires (Dev)
- larastan/larastan: ^3.0
- marcin-orlowski/lockpick: ^1.0
- marcin-orlowski/phpunit-extra-asserts: ^5.1.0
- orchestra/testbench: ^10.0
- phpunit/php-code-coverage: ^11.0
- phpunit/phpunit: ^11.0
- dev-master
- 12.0.1
- 12.0.0
- v11.x-dev
- 11.0.0
- v10.x-dev
- 10.0.0
- v9.x-dev
- 9.4.0
- 9.3.2
- 9.3.1
- 9.3.0
- 9.2.3
- 9.2.2
- 9.2.1
- 9.2.0
- 9.1.1
- 9.1.0
- 9.0.3
- 9.0.2
- 9.0.1
- 9.0.0
- v8.x-dev
- 8.1.1
- 8.1.0
- 8.0.1
- 8.0.0
- v7.x-dev
- 7.1.2
- 7.1.1
- 7.1.0
- 7.0.3
- 7.0.1
- 7.0.0
- v6.x-dev
- 6.3.2
- 6.3.1
- 6.3.0
- 6.2.3
- 6.2.2
- 6.2.1
- 6.2.0
- 6.1.2
- 6.1.1
- 6.1.0
- 6.0.0
- 4.1.9
- 4.1.7
- 4.1.6
- 4.1.5
- 4.1.3
- 4.1.2
- 4.1.1
- 4.0.2
- 4.0.1
- 4.0.0
- 3.2.1
- 3.2.0
- 3.1.0
- 3.0.3
- 3.0.1
- 3.0.0
- 2.2.1
- 2.2.0
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.0
- v1.5.0
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.0
- v1.2.0
- v1.1.0
- v1.0.1
- v1.0.0
- dev-dev
- dev-fix/gh-263-validator-contract
- dev-feature/update-workflows-261
- dev-toarray-fix
- dev-request-fix
- dev-laravel-12
This package is auto-updated.
Last update: 2025-04-16 22:04:03 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 developers, drawing from extensive experience on both
sides of API development. It's lightweight, with no dependencies, thoroughly tested, and simple to use while remaining
flexible and powerful. It offers support for on-the-fly data conversion, localization,
automatic message building, chained APIs, and comprehensive documentation.
Moreover, the JSON structure produced by ResponseBuilder
is designed with your API users in mind. Its
well-defined and predictable structure makes interacting with your API using
ResponseBuilder
effortless. The simple, consistent JSON responses are easy to consume without any complications.
Your clients will appreciate it, and by extension, appreciate you as well!
You're also covered in case of emergencies. The provided ExceptionHandlerHelper ensures your API continues to communicate in JSON (not HTML) with its clients, even in unexpected situations.
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 free of charge?
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-2025 by Marcin Orlowski <mail (#) marcinorlowski (.) com>
- ResponseBuilder is open-sourced software licensed under the MIT license