定制 rapidwebltd/no-post-data-laravel-middleware 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

rapidwebltd/no-post-data-laravel-middleware

Composer 安装命令:

composer require rapidwebltd/no-post-data-laravel-middleware

包简介

Under certain conditions, when posting data from a form, the web server may lose the post data. This commonly happens if a user is uploading a large file beyond the size limits set in the web server's configuration. Laravel does not handle this situation and may end up throwing a somewhat confusing

README 文档

README

Under certain conditions, when posting data from a form, the web server may lose the post data. This commonly happens if a user is uploading a large file beyond the size limits set in the web server's configuration.

Laravel does not handle this situation and may end up throwing a somewhat confusing TokenMismatchException in VerifyCsrfToken due to CSRF protection.

The 'No Post Data Laravel Middleware' handles situations in which a post request has been submitted and contains no post data - a situation which should not occur under normal usage. By default, the middleware will redirect back to the previous page with an error message flashed to the session. This can then be output on your view as you would normally handle validation errors.

If needed, you can also modify this default behaviour and allow any code to run when the 'post request with no post data' situation is encountered.

Installation

  1. Run composer require rapidwebltd/no-post-data-laravel-middleware.
  2. Add RapidWeb\NoPostDataLaravelMiddleware\ServiceProvider::class, to the providers array in your config/app.php file.
  3. Add \RapidWeb\NoPostDataLaravelMiddleware\Http\Middleware\NoPostData::class, to the middleware array in your app/Http/Kernel.php file. This must be added after \Illuminate\View\Middleware\ShareErrorsFromSession::class, and before \App\Http\Middleware\VerifyCsrfToken::class,.
  4. Run php artisan vendor:publish.
  5. If you wish, edit the default errorMessage variable in your newly published config/nopostdata.php file.
  6. If you want to fully change the middleware's behaviour, you can also edit the closure variable found in the config/nopostdata.php file.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: LGPL-3.0-only
  • 更新时间: 2017-02-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固