PHPackages                             foothing/uniform-json-responses - 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. foothing/uniform-json-responses

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

foothing/uniform-json-responses
===============================

A PHP trait to uniform http responses.

0.1.0(9y ago)01181MITPHPPHP &gt;=5.5.0

Since Jul 22Pushed 9y ago1 watchersCompare

[ Source](https://github.com/foothing/uniform-json-responses)[ Packagist](https://packagist.org/packages/foothing/uniform-json-responses)[ RSS](/packages/foothing-uniform-json-responses/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (4)Versions (3)Used By (1)

PHP Uniform HTTP responses
==========================

[](#php-uniform-http-responses)

This is a tiny package meant to be used within Laravel. It defines a `trait` that can be used to wrap and uniform JSON responses to a reusable format.

Install
-------

[](#install)

`composer require foothing/uniform-json-responses`

Usage
-----

[](#usage)

Simply add the trait to your Controller and have your controller actions to return content via the trait `success` or `fail` api.

```
class FooController {

	use WrapsResponses;

	public function getIndex() {
		// Do stuff
		return $this->success($dataToBeJSONed, 'Hey! It works.');
	}

	public function putIndex() {
		// Do more bad stuff.
		return $this->fail("Doh, this is broken", 500);
	}

}
```

The messages you can pass along with `success` and `fail`will be included in a `X-Status-Message` header.

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

3298d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9ebf3a4938226620036760ed05bf0d6801b7bc2c383a1fd7dd1a4c48ba84145d?d=identicon)[brazorf](/maintainers/brazorf)

---

Top Contributors

[![brazorf](https://avatars.githubusercontent.com/u/3330031?v=4)](https://github.com/brazorf "brazorf (6 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/foothing-uniform-json-responses/health.svg)

```
[![Health](https://phpackages.com/badges/foothing-uniform-json-responses/health.svg)](https://phpackages.com/packages/foothing-uniform-json-responses)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

59156.3k11](/packages/api-platform-laravel)[infinitypaul/idempotency-laravel

Elegant and production-ready idempotency middleware for Laravel APIs.

13622.1k](/packages/infinitypaul-idempotency-laravel)[onlime/laravel-http-client-global-logger

A global logger for the Laravel HTTP Client

2037.5k](/packages/onlime-laravel-http-client-global-logger)[open-southeners/laravel-response-compression

Add server-side response compression with a range of different algorithms (Gzip, brotli, deflate...)

15129.3k](/packages/open-southeners-laravel-response-compression)[laragear/json

Easily retrieve and manipulate `Json` across your application.

364.0k](/packages/laragear-json)

PHPackages © 2026

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