PHPackages                             chatbox-inc/lumen-restapi - 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. chatbox-inc/lumen-restapi

ActiveLibrary[API Development](/categories/api)

chatbox-inc/lumen-restapi
=========================

0.0.2(9y ago)044PHP

Since Oct 1Pushed 9y ago2 watchersCompare

[ Source](https://github.com/chatbox-inc/lumen-restapi)[ Packagist](https://packagist.org/packages/chatbox-inc/lumen-restapi)[ RSS](/packages/chatbox-inc-lumen-restapi/feed)WikiDiscussions master Synced 3w ago

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

Lumen Application
=================

[](#lumen-application)

[![Latest Stable Version](https://camo.githubusercontent.com/6c10df023b1e99d03a966ed3796d453b560b18f06f1bf4434a222b5c52e113f8/68747470733a2f2f706f7365722e707567782e6f72672f63686174626f782d696e632f6c756d656e2d726573746170692f76657273696f6e)](https://packagist.org/packages/chatbox-inc/lumen-restapi)[![License](https://camo.githubusercontent.com/d5a293d4a134273d64e2234da71a1aa7f8a03fd825d9e17c4285c00e14b05dbe/68747470733a2f2f706f7365722e707567782e6f72672f63686174626f782d696e632f6c756d656e2d726573746170692f6c6963656e7365)](https://packagist.org/packages/chatbox-inc/lumen-restapi)[![composer.lock available](https://camo.githubusercontent.com/598862ebb6ef072501a80559cc915ce57a640dccb300ab49c8465d28ab677b49/68747470733a2f2f706f7365722e707567782e6f72672f63686174626f782d696e632f6c756d656e2d726573746170692f636f6d706f7365726c6f636b)](https://packagist.org/packages/chatbox-inc/lumen-restapi)

Rest API アプリケーション作成用のミドルウェア

レスポンス生成の一元化とエラーハンドリングを担う。

機能
--

[](#機能)

- RestAPI Response整形の1極化
- ExceptionHandlerの搭載

Usage
-----

[](#usage)

Exception Handler はデフォルトのものを使用する想定

```
$app->singleton(\Illuminate\Contracts\Debug\ExceptionHandler::class,\App\Exceptions\Handler::class);

```

対象のルートにミドルウェアを二枚かける

ミドルウェアの設定順序には注意すること。

```
$app->group([
    "middleware" => [
        \Chatbox\RestAPI\Http\Middleware\HttpExceptionHandler::class,
        \Chatbox\RestAPI\Http\Middleware\APIResponseHandler::class
        ]
],function($router){
    $router->get("/api/status",function(){
        return [];
    });

    $router->get("/api/missing",function(){
        abort(404);
    });

    $router->get("/api/error",function(){
        throw new \Exception();
    });
});

```

拡張
--

[](#拡張)

全ての例外は一度 HttpRequest で投げられるので、そこから処理してあげると楽だったり。

400 系エラー例外はHttpExcepiton 継承で投げると特別処理がかかる。

### Responseを操作する時

[](#responseを操作する時)

\\Chatbox\\RestAPI\\Http\\Response を拡張する。

### Exceptionsを操作する時

[](#exceptionsを操作する時)

\\Chatbox\\RestAPI\\Exceptions\\Handler を拡張する。

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

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 ~0 days

Total

2

Last Release

3559d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a0dd32f123fcf9eb9a5a7a8ac609266eb470babf23631c3687d59d28c067396f?d=identicon)[mikakane](/maintainers/mikakane)

### Embed Badge

![Health badge](/badges/chatbox-inc-lumen-restapi/health.svg)

```
[![Health](https://phpackages.com/badges/chatbox-inc-lumen-restapi/health.svg)](https://phpackages.com/packages/chatbox-inc-lumen-restapi)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

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