PHPackages                             witify/laravel-json-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. witify/laravel-json-response

ActiveLibrary[API Development](/categories/api)

witify/laravel-json-response
============================

Quickly make JSON responses in Laravel

1.2.0(4y ago)15.5kMITPHPPHP ^7.1|^8.0CI failing

Since May 14Pushed 4y ago2 watchersCompare

[ Source](https://github.com/Witify/laravel-json-response)[ Packagist](https://packagist.org/packages/witify/laravel-json-response)[ Docs](https://github.com/Witify/laravel-json-response)[ RSS](/packages/witify-laravel-json-response/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (3)Versions (11)Used By (0)

Quick JSON reponses in Laravel
==============================

[](#quick-json-reponses-in-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5f89e1773867432ee03a14cbddfd97c8368c7dd30ec5012d484eb9d1ae2b7aed/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f5769746966792f6c61726176656c2d6a736f6e2d726573706f6e73652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/witify/laravel-json-response)[![Build Status](https://camo.githubusercontent.com/a88e8d7f404f0eec24bd68c6c3ce2a97528fc2231f95fdfdb3c4f00373d6d2a9/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f5769746966792f6c61726176656c2d6a736f6e2d726573706f6e73652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/witify/laravel-json-response)[![Maintainability](https://camo.githubusercontent.com/da29e2bdfce3b81f6a479d8d4a54cca3f8355290edca61af343a1a7433c4f927/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f64353336643661306163666634343433336336392f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/Witify/laravel-json-response/maintainability)[![Test Coverage](https://camo.githubusercontent.com/0778c9b983dfa12546f402242a648aaf5eaf9b37ab048d71f39b70a960606c5b/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f64353336643661306163666634343433336336392f746573745f636f766572616765)](https://codeclimate.com/github/Witify/laravel-json-response/test_coverage)[![Total Downloads](https://camo.githubusercontent.com/bf3197d7e74f790901ab55f7c9784bfc803e68d65b434ee33f6f3746188013a1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f5769746966792f6c61726176656c2d6a736f6e2d726573706f6e73652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/witify/laravel-json-response)

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

[](#installation)

You can install the package via composer:

```
composer require witify/laravel-json-response
```

Usage
-----

[](#usage)

Add it to your controller:

```
use Witify\LaravelJsonReponse\JsonTrait;

class ApiController extends Controller {
    use JsonTrait;
}
```

Available methods
-----------------

[](#available-methods)

MethodDescriptionsetStatusCode(int $statusCode)Set the status code of the responsegetStatusCode(int $statusCode)Get the status code of the responseresponse($data, $headers = \[\])Create a json responsesuccess($message = "", $data = null)Create a successful json responseerror($message = "", $data = null)Create a failed json response### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [François Lévesque](https://github.com/francoislevesque)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 68.8% 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 ~125 days

Recently: every ~193 days

Total

10

Last Release

1798d ago

PHP version history (2 changes)1.0.0PHP ^7.1

1.2.0PHP ^7.1|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/0da4aab93bdcb97dcfbb14e8f8fd038dedfe50eb4ba03c52e2f5432838929ce4?d=identicon)[francoislevesque](/maintainers/francoislevesque)

---

Top Contributors

[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (66 commits)")[![sebastiandedeyne](https://avatars.githubusercontent.com/u/1561079?v=4)](https://github.com/sebastiandedeyne "sebastiandedeyne (13 commits)")[![francoislevesque](https://avatars.githubusercontent.com/u/14022409?v=4)](https://github.com/francoislevesque "francoislevesque (5 commits)")[![willemvb](https://avatars.githubusercontent.com/u/1336390?v=4)](https://github.com/willemvb "willemvb (3 commits)")[![brendt](https://avatars.githubusercontent.com/u/6905297?v=4)](https://github.com/brendt "brendt (2 commits)")[![gizburdt](https://avatars.githubusercontent.com/u/1470623?v=4)](https://github.com/gizburdt "gizburdt (2 commits)")[![m1guelpf](https://avatars.githubusercontent.com/u/23558090?v=4)](https://github.com/m1guelpf "m1guelpf (1 commits)")[![sixlive](https://avatars.githubusercontent.com/u/5108034?v=4)](https://github.com/sixlive "sixlive (1 commits)")[![strebl](https://avatars.githubusercontent.com/u/6151204?v=4)](https://github.com/strebl "strebl (1 commits)")[![svenluijten](https://avatars.githubusercontent.com/u/11269635?v=4)](https://github.com/svenluijten "svenluijten (1 commits)")[![kapersoft](https://avatars.githubusercontent.com/u/13007854?v=4)](https://github.com/kapersoft "kapersoft (1 commits)")

---

Tags

laravelJSON responses

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/witify-laravel-json-response/health.svg)

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

###  Alternatives

[darkaonline/l5-swagger

OpenApi or Swagger integration to Laravel

2.9k34.0M112](/packages/darkaonline-l5-swagger)[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[statamic/cms

The Statamic CMS Core Package

4.8k3.2M720](/packages/statamic-cms)[knuckleswtf/scribe

Generate API documentation for humans from your Laravel codebase.✍

2.3k12.2M45](/packages/knuckleswtf-scribe)[vemcogroup/laravel-weather

Weather package for Laravel to use different providers to get weather info

5525.0k](/packages/vemcogroup-laravel-weather)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

762.6k](/packages/scriptdevelop-whatsapp-manager)

PHPackages © 2026

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