PHPackages                             miladev/api-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. [API Development](/categories/api)
4. /
5. miladev/api-response

ActiveLibrary[API Development](/categories/api)

miladev/api-response
====================

A simple Laravel package for success and fail response traits.

1.0.1(7mo ago)116MITPHPPHP &gt;=8.2CI passing

Since Aug 10Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/miladev95/api-response)[ Packagist](https://packagist.org/packages/miladev/api-response)[ Docs](https://github.com/miladev95/api-response)[ RSS](/packages/miladev-api-response/feed)WikiDiscussions master Synced today

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

Laravel Api Response
====================

[](#laravel-api-response)

A small, framework-friendly trait that standardizes JSON API responses (success and error). The trait is lightweight and designed to be easy to override in consuming applications.

Features
--------

[](#features)

- Standardized JSON success and error responses
- Small and framework-agnostic: prefers framework response helpers when available
- Extensible: override payload shape or header handling

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1
- ext-json

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

[](#installation)

Install via Composer:

```
composer require miladev/api-response
```

Quick usage (Laravel)
---------------------

[](#quick-usage-laravel)

```
