PHPackages                             marcin-orlowski/laravel-api-response-builder - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. marcin-orlowski/laravel-api-response-builder

ActiveLibrary[HTTP &amp; Networking](/categories/http)

marcin-orlowski/laravel-api-response-builder
============================================

Helps building nice, normalized and easy to consume Laravel REST API.

12.1.3(3mo ago)837458.6k—10%833MITPHPPHP ^8.2|^8.3|^8.4|^8.5CI passing

Since Apr 11Pushed 3mo ago14 watchersCompare

[ Source](https://github.com/MarcinOrlowski/laravel-api-response-builder)[ Packagist](https://packagist.org/packages/marcin-orlowski/laravel-api-response-builder)[ Docs](https://github.com/MarcinOrlowski/laravel-api-response-builder)[ RSS](/packages/marcin-orlowski-laravel-api-response-builder/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (84)Used By (3)

[![REST API Response Builder for Laravel](artwork/laravel-api-response-builder-logo.webp)](artwork/laravel-api-response-builder-logo.webp)

REST API Response Builder for Laravel
=====================================

[](#rest-api-response-builder-for-laravel)

[![Latest Stable Version](https://camo.githubusercontent.com/6143f9c3a72b5ad8e9555c6a51ab3d6d182929c55a20634618ef694567433aea/68747470733a2f2f706f7365722e707567782e6f72672f6d617263696e2d6f726c6f77736b692f6c61726176656c2d6170692d726573706f6e73652d6275696c6465722f76)](https://packagist.org/packages/marcin-orlowski/laravel-api-response-builder)[![Codacy Grade Badge](https://camo.githubusercontent.com/de7d1cedaa83ef244eb424d81a9ae5880ed598051593e87c5e3816369c71f34e/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3434663432376538373265323438303539376264653032343234313761326137)](https://www.codacy.com/app/MarcinOrlowski/laravel-api-response-builder)[![Monthly Downloads](https://camo.githubusercontent.com/f1e0f3ebf85f6998f75f615fa855e610606a6f784e09c8f02963ca48b2954318/68747470733a2f2f706f7365722e707567782e6f72672f6d617263696e2d6f726c6f77736b692f6c61726176656c2d6170692d726573706f6e73652d6275696c6465722f642f6d6f6e74686c79)](https://packagist.org/packages/marcin-orlowski/laravel-api-response-builder)[![Code Quality](https://camo.githubusercontent.com/2db9555d67c6fe1cd49a393ec5909891d9f4d58236b3a26e8ee96252192009ec/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4d617263696e4f726c6f77736b692f6c61726176656c2d6170692d726573706f6e73652d6275696c6465722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/MarcinOrlowski/laravel-api-response-builder/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/1c49e4ee1ea749d1c5f45649df3d45469e1b23cd3c7933661aeb504c930e282a/68747470733a2f2f636f6465636f762e696f2f67682f4d617263696e4f726c6f77736b692f6c61726176656c2d6170692d726573706f6e73652d6275696c6465722f6272616e63682f6d61737465722f67726170682f62616467652e7376673f746f6b656e3d7333576e76686949376e)](https://codecov.io/gh/MarcinOrlowski/laravel-api-response-builder)[![License](https://camo.githubusercontent.com/4fd3b4b4e01429f78c346c3f12abce40e85de26c82ffde68087338f1cbc1849b/68747470733a2f2f706f7365722e707567782e6f72672f6d617263696e2d6f726c6f77736b692f6c61726176656c2d6170692d726573706f6e73652d6275696c6465722f6c6963656e7365)](https://packagist.org/packages/marcin-orlowski/laravel-api-response-builder)

Table of contents
-----------------

[](#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
------------

[](#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
--------

[](#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
--------

[](#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
-------

[](#license)

- Written and copyrighted ©2016-2026 by Marcin Orlowski &lt;mail (#) marcinorlowski (.) com&gt;
- ResponseBuilder is open-source software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

71

—

ExcellentBetter than 100% of packages

Maintenance80

Actively maintained with recent releases

Popularity60

Solid adoption and visibility

Community30

Small or concentrated contributor base

Maturity96

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 98.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~44 days

Recently: every ~51 days

Total

81

Last Release

108d ago

Major Versions

7.1.2 → 8.0.02020-07-14

v8.x-dev → 9.0.02020-10-17

v9.x-dev → 10.0.02023-02-20

v10.x-dev → v11.x-dev2024-05-06

11.0.0 → 12.0.02025-04-16

PHP version history (9 changes)v1.0.0PHP &gt;=5.4.0

v2.1.0PHP &gt;=5.5.9

6.0.0PHP &gt;=7.2.0

9.3.0PHP ^7.2 | ^7.3 | ^8.0

9.4.0PHP ^8.0|^8.1

10.0.0PHP ^8.1|^8.2

v11.x-devPHP ^8.2|^8.3

12.0.0PHP ^8.2|^8.3|^8.4

12.1.2PHP ^8.2|^8.3|^8.4|^8.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/8870db56c4a0f54e86e6d574b761bac8654795bdad7b52b3ccdb6a42f0d4af80?d=identicon)[MarcinOrlowski](/maintainers/MarcinOrlowski)

---

Top Contributors

[![MarcinOrlowski](https://avatars.githubusercontent.com/u/8041294?v=4)](https://github.com/MarcinOrlowski "MarcinOrlowski (1579 commits)")[![iamroi](https://avatars.githubusercontent.com/u/4452859?v=4)](https://github.com/iamroi "iamroi (11 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (2 commits)")[![mustafa-online](https://avatars.githubusercontent.com/u/5323832?v=4)](https://github.com/mustafa-online "mustafa-online (1 commits)")[![ehsan-soleimanian](https://avatars.githubusercontent.com/u/59331480?v=4)](https://github.com/ehsan-soleimanian "ehsan-soleimanian (1 commits)")[![victorioustr](https://avatars.githubusercontent.com/u/7466590?v=4)](https://github.com/victorioustr "victorioustr (1 commits)")[![FaridAghili](https://avatars.githubusercontent.com/u/8607021?v=4)](https://github.com/FaridAghili "FaridAghili (1 commits)")[![jcmcclorey](https://avatars.githubusercontent.com/u/33734757?v=4)](https://github.com/jcmcclorey "jcmcclorey (1 commits)")

---

Tags

apiapi-helperchained-apisjsonjson-responselaravelphprest-apiphpjsonapilaravelhelperrestbuildermobileandroidiosphp8php8.3laravel10php82

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

### Embed Badge

![Health badge](/badges/marcin-orlowski-laravel-api-response-builder/health.svg)

```
[![Health](https://phpackages.com/badges/marcin-orlowski-laravel-api-response-builder/health.svg)](https://phpackages.com/packages/marcin-orlowski-laravel-api-response-builder)
```

###  Alternatives

[givebutter/laravel-keyable

Add API keys to your Laravel models

187144.5k2](/packages/givebutter-laravel-keyable)[lomkit/laravel-rest-api

A package to build quick and robust rest api for the Laravel framework.

59152.2k](/packages/lomkit-laravel-rest-api)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[guanguans/laravel-api-response

Normalize and standardize Laravel API response data structure. - 规范化和标准化 Laravel API 响应数据结构。

485.6k](/packages/guanguans-laravel-api-response)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
