Package Data | |
---|---|
Maintainer Username: | FredyHenao |
Maintainer Contact: | fredyhenao45y@gmail.com (Fredy Henao) |
Package Create Date: | 2019-09-17 |
Package Last Update: | 2020-01-08 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-12-15 15:23:53 |
Package Statistics | |
---|---|
Total Downloads: | 11 |
Monthly Downloads: | 2 |
Daily Downloads: | 0 |
Total Stars: | 1 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Laravel Form Request for adaptation to the Lumen structure and validation of the parameters that come by URL.
Via Composer
$ composer require fredyhenaodev/lumen-form-request-url
$app->register(Fredyhenaodev\Providers\FormRequestServiceProvider::class);
<?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'
];
}
}
If you discover any security related issues, please email fredyhenao45ygmail.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.