PHPackages                             jgautheron/slim-jsend - 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. jgautheron/slim-jsend

ActiveLibrary[API Development](/categories/api)

jgautheron/slim-jsend
=====================

JSend implementation for the Slim PHP framework

064PHP

Since Apr 1Pushed 11y agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

SlimJsend
=========

[](#slimjsend)

JSend middleware for the Slim PHP framework.

How to install
--------------

[](#how-to-install)

You can install SlimJsend with Composer by:

```
composer install jgautheron/slim-jsend

```

or adding this line to your `composer.json` file:

```
"jgautheron/slim-jsend": "dev-master"

```

How to use
----------

[](#how-to-use)

```
require 'vendor/autoload.php';
$app = new \Slim\Slim();

// Add the middleware globally
$app->add(new \SlimJsend\Middleware([
    // true means *
    'cors' => true,
    // for a finer control over the allowed origin
    'cors' => 'https://foo.com'
]));

$app->get('/', function() use ($app) {
    // SlimJsend will automatically generate the proper JSend response depending of the status code
    $app->render(200, $messages); // success
    $app->render(500, $data); // fail

    // if an exception is thrown, it will be automatically converted to a JSend error message
    throw new Exception('Uh oh... missing username');
});

$app->run();
```

Credits
-------

[](#credits)

-
-
-

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/57eea70af9b595fe6503641f9f58fb5cbc5edd20aabb9b4419c45bd8d29d7684?d=identicon)[jgautheron](/maintainers/jgautheron)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/jgautheron-slim-jsend/health.svg)

```
[![Health](https://phpackages.com/badges/jgautheron-slim-jsend/health.svg)](https://phpackages.com/packages/jgautheron-slim-jsend)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M271](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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