open-cetacean/laravel-json-header
Composer 安装命令:
composer require open-cetacean/laravel-json-header
包简介
Middleware to force Laravel API group to JSON header
README 文档
README
open-cetacean/laravel-json-header is a PHP package built for Laravel to force Laravel API group to JSON header activating wantsJson()
Installation
This project can be installed via Composer. Add the following line to the require block of your composer.json file:
{
"require": {
"open-cetacean/laravel-json-header": "^1.0"
}
}
You'll then run composer install or composer update.
Or run the following command:
composer require open-cetacean/laravel-json-header
Middleware
To register the middleware add the following to the $routeMiddleware array within the app/Http/Kernel.php file:
protected $routeMiddleware = [ // ... 'acceptJson' => \OpenCetacean\JsonHeader\Middleware\AcceptJson::class, // ... ];
then add the middleware to your API routes:
Route::group(['middleware' => ['api', 'acceptJson']], function () { // ... }
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 757
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-01-26