https://github.com/marcinorlowski/laravel-api-response-builder
Builds nice, normalized and easy to consume REST JSON responses for Laravel powered APIs.
https://github.com/marcinorlowski/laravel-api-response-builder
api api-helper chained-apis json json-response laravel php rest-api
Last synced: 2 months ago
JSON representation
Builds nice, normalized and easy to consume REST JSON responses for Laravel powered APIs.
- Host: GitHub
- URL: https://github.com/marcinorlowski/laravel-api-response-builder
- Owner: MarcinOrlowski
- License: mit
- Created: 2016-04-11T20:43:12.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2024-12-12T11:17:24.000Z (about 1 year ago)
- Last Synced: 2025-04-10T19:51:07.496Z (11 months ago)
- Topics: api, api-helper, chained-apis, json, json-response, laravel, php, rest-api
- Language: PHP
- Homepage:
- Size: 1.9 MB
- Stars: 768
- Watchers: 16
- Forks: 84
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: docs/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README

# REST API Response Builder for Laravel
[](https://packagist.org/packages/marcin-orlowski/laravel-api-response-builder)
[](https://www.codacy.com/app/MarcinOrlowski/laravel-api-response-builder)
[](https://packagist.org/packages/marcin-orlowski/laravel-api-response-builder)
[](https://scrutinizer-ci.com/g/MarcinOrlowski/laravel-api-response-builder/?branch=master)
[](https://codecov.io/gh/MarcinOrlowski/laravel-api-response-builder)
[](https://packagist.org/packages/marcin-orlowski/laravel-api-response-builder)
## Table of contents
* [Introduction](#introduction)
* [Why should I use it?](#benefits)
* [Usage examples](docs/examples.md#usage-examples)
* [Features](#features)
* [Extensive documentation](docs/README.md)
* [License](#license)
* [Changelog](docs/CHANGES.md)
----
## Introduction
`ResponseBuilder` is a [Laravel](https://laravel.com/) package, designed to help you build 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, has **no** dependencies, is
thoroughly tested, and is simple to use while remaining flexible and powerful. It offers support
for [on-the-fly data conversion](docs/conversion.md), [localization](docs/docs.md#messages-and-localization),
automatic message building, [chained APIs](docs/docs.md#code-ranges),
and [comprehensive documentation](docs/README.md).
Moreover, the JSON structure produced by `ResponseBuilder` is designed with **your API users** in
mind. Its [well-defined and predictable structure](docs/docs.md#response-structure) makes
interacting with your API using `ResponseBuilder` effortless. The simple, consistent JSON responses
are easy to consume. **Your** clients will appreciate it!
You're also covered in case of emergencies. The provided
[ExceptionHandlerHelper](docs/exceptions.md) ensures your API continues to communicate in
JSON (not HTML) with its clients, even in unexpected situations.
Additionally, it includes [testing traits](docs/testing.md) that help you add PHPUnit-based tests
for your `ResponseBuilder` integration with just a few lines of code.
## Features
* [Easy to use](docs/examples.md#usage-examples),
* [Stable and production ready](https://github.com/MarcinOrlowski/laravel-api-response-builder/releases)
* [On-the-fly data object conversion](docs/conversion.md),
* [API chaining support](docs/docs.md#code-ranges),
* [Localization support](docs/docs.md#messages-and-localization),
* Provides traits to help [unit test your API code](docs/testing.md),
* Comes with an [exception handler helper](docs/exceptions.md) to ensure your API remains consumable
even in unexpected situations.
* [No additional dependencies](composer.json).
## License
* Written and copyrighted ©2016-2026 by Marcin Orlowski
* ResponseBuilder is open-source software licensed under
the [MIT license](http://opensource.org/licenses/MIT)