generationtux/json-middleware 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

generationtux/json-middleware

最新稳定版本:v1.2

Composer 安装命令:

composer require generationtux/json-middleware

包简介

A simple laravel/lumen middleware for denying non-json POST and PUT requests.

README 文档

README

A simple laravel/lumen middleware for denying non-json POST and PUT requests.

Installation

You can install json-middleware via composer.

$ composer require generationtux/json-middleware:~1.0

Once installed you simply need to register the middleware.

Laravel

You should register the middleware in the App\Http\Kerenel.php. You can opt to apply the middleware gloablly to all routes, or simply register it under the routes middelware and manually apply it to specific routes.

    /**
     * The application's global HTTP middleware stack.
     *
     * @var array
     */
    protected $middleware = [
        'isjson'  => ValidateIsJsonMiddleware::class
    ];

Lumen

Lumen requires you to register the middleware in bootstrap/app.php but again you may opt to register the middleware gloablly or not, it's up to you.

	/*
	|--------------------------------------------------------------------------
	| Register Middleware
	|--------------------------------------------------------------------------
	|
	| Next, we will register the middleware with the application. These can
	| be global middleware that run before and after each request into a
	| route or middleware that'll be assigned to some specific routes.
	|
	*/
	$app->middleware([
	    GenTux\Json\Http\ValidateIsJsonMiddleware::class
	]);

统计信息

  • 总下载量: 4.69k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 21
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-09-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固