dev-master
9999999-devExtend Laravel 5's request.
MIT
The Requires
- php >=5.4.0
- illuminate/support ~5.0
The Development Requires
by Lucas Padilha Gois
laravel request
Extend Laravel 5's request.
Package that exteds the Laravel 5 FormRequest class to easily create custom validation rules., (*1)
In the require
key of composer.json
file add the following, (*2)
"lukzgois/request": "dev-master"
Run the Composer update comand, (*3)
$ composer update
Make your request extends the Lukzgois\Request\Request
class., (*4)
use Lukzgois\Request\Request; class MyRequest extends Request {
Create your rules function with your custom rule:, (*5)
public function rules() { return [ 'my-rule' => 'custom' ]; }
Create a function with the format validate<your_custom_rule>
, like this:, (*6)
public function validateCustom($attribute, $value, $params) { return $value == 'custom'; }
Do not forget to put a message for this new rule. It can be in the messages
function of the request or in the validation
of the lang files., (*7)
public fucnction messages() { return [ 'custom' => 'My custom message' ]; }
And that is it HAHA! :) Please enjoy!, (*8)
Extend Laravel 5's request.
MIT
laravel request