fredyhenaodev/lumen-form-request-url
Composer 安装命令:
composer require fredyhenaodev/lumen-form-request-url
包简介
Laravel Form Request adaptation for Lumen framework and validation of the parameters that come by URL.
README 文档
README
Laravel Form Request for adaptation to the Lumen structure and validation of the parameters that come by URL.
Install
Via Composer
$ composer require fredyhenaodev/lumen-form-request-url
- Add the service provider in bootstrap/app.php
$app->register(Fredyhenaodev\Providers\FormRequestServiceProvider::class);
Usage
<?php namespace App\Http\Request; use Fredyhenaodev\Requests\FormRequestUrl; class FindUserByIdRequest extends RequestUrl { /** * Defining the URL parameters (`/stores/78/FredyHenao`) allows applying * validation rules on them and allows accessing them like request data. * * @var array */ protected $urlParameters = [ 'id', 'name' ]; /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return [ 'id' => 'required|exists:users,id', 'name' => 'required|string' ]; } }
Security
If you discover any security related issues, please email fredyhenao45y@gmail.com instead of using the issue tracker.
Credits
- Fredy Henao GitHub
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 11
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-09-17