lextira/laravel-formrequest-singleton
最新稳定版本:v1.1.0
Composer 安装命令:
composer require lextira/laravel-formrequest-singleton
包简介
Use Laravel's excellent FormRequest as Singleton.
README 文档
README
Use Laravel's excellent FormRequest as Scoped
Installation
- run
composer require lextira/laravel-formrequest-singleton - open
config/app.phpin your project - replace
Illuminate\Foundation\Providers\FoundationServiceProvider::class
withLextira\FormRequestSingleton\FoundationServiceProvider::class - done!
Usage
All classes, which extend Illuminate\Foundation\Http\FormRequest are now instantiated as scoped.
This brings the following benefits:
- Changes done to the request by
prepareForValidation()are applied only once, even if the FormRequest is used multiple times. - The request validation is run only once, therefore especially database queries run only once.
统计信息
- 总下载量: 4.06k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-02-07