PHPackages                             tattran22/response - 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. tattran22/response

ActiveLibrary

tattran22/response
==================

Easy API Response Transformation for Laravel

2.0.4(2y ago)07PHPPHP ^8.0

Since May 26Pushed 2y agoCompare

[ Source](https://github.com/TatTran22/response)[ Packagist](https://packagist.org/packages/tattran22/response)[ RSS](/packages/tattran22-response/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (7)Used By (0)

TatTran22/Response: Easy API Response Transformation for Laravel
----------------------------------------------------------------

[](#tattran22response-easy-api-response-transformation-for-laravel)

This Laravel package simplifies handling API responses using the Fractal library. It lets you easily:

- **Transform data:** Convert raw data into structured responses.
- **Include relationships:** Add related data to your responses without separate requests.
- **Handle pagination:** Automatically add pagination links and metadata.

Installation
------------

[](#installation)

Just run this command in your terminal:

```
composer require tattran22/response
```

Usage
-----

[](#usage)

1. **Prepare your data:** Use Eloquent models, arrays, or any suitable format.
2. **Create a transformer:** Define how to transform your data using a `ResponseTransformer` class.
3. **Transform your data:** Call `transformData` with your data and transformer. ```
    use TatTran\Response\Transformers\ResponseTransformer;

    $transformer = new ResponseTransformer($manager);
    $response = $transformer->transformData($data, $transformerInstance);
    ```
4. **(Optional) Include relationships:** Add `include` parameters to your API requests (e.g., `?include=relationship`). ```
    $transformer->setIncludes(['include1', 'include2']);
    ```

Features
--------

[](#features)

- **Easy transformation:** Define transformations in clear, readable code.
- **Includes parsing:** Automatically handle `include` query parameters.
- **Pagination support:** Add pagination links and metadata seamlessly.
- **Set includes programmatically:** Control included relationships in code.

Open Source &amp; Credits
-------------------------

[](#open-source--credits)

This package is free to use under the MIT license and developed by [Tat Tran](https://tattran.com).

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 83.3% 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 ~207 days

Recently: every ~0 days

Total

6

Last Release

780d ago

Major Versions

v1.0 → 2.0.02024-03-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/8695ae124e531a243247b1e55dd068ed4d80d16f0a0961e7b3986a4468550248?d=identicon)[tattran.dev](/maintainers/tattran.dev)

---

Top Contributors

[![TatTran22](https://avatars.githubusercontent.com/u/29831741?v=4)](https://github.com/TatTran22 "TatTran22 (10 commits)")[![lekhang2512](https://avatars.githubusercontent.com/u/21123866?v=4)](https://github.com/lekhang2512 "lekhang2512 (2 commits)")

### Embed Badge

![Health badge](/badges/tattran22-response/health.svg)

```
[![Health](https://phpackages.com/badges/tattran22-response/health.svg)](https://phpackages.com/packages/tattran22-response)
```

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135192.6k5](/packages/statamic-rad-pack-runway)

PHPackages © 2026

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