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 6d 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 30% 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

3343d 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

[spatie/laravel-webhook-client

Receive webhooks in Laravel apps

1.2k13.7M136](/packages/spatie-laravel-webhook-client)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45844.8k1](/packages/pressbooks-pressbooks)[onlime/laravel-http-client-global-logger

A global logger for the Laravel HTTP Client

2040.3k](/packages/onlime-laravel-http-client-global-logger)[forjedio/inertia-table

Backend-driven dynamic tables for Laravel + Inertia.js

272.0k](/packages/forjedio-inertia-table)

PHPackages © 2026

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