Download the PHP package filippo-toso/validate-function without Composer
On this page you can find all versions of the php package filippo-toso/validate-function. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download filippo-toso/validate-function
More information about filippo-toso/validate-function
Files in filippo-toso/validate-function
Package validate-function
Short Description A simple function that helps validating input for use in API development.
License MIT
Informations about the package validate-function
Validation Function
A simple function that helps validating inputs for use in API development.
Requirements
- PHP 7.1.3+
- Illumintate HTTP 5.5+
- Illumintate Support 5.5+
Installing
Use Composer to install it:
Function Signature
Here is the signature of the validate() function:
Using It
Here is the simples example:
If you prefer, you can achieve the same result using the callable in the second parameter:
The third parameter is also a callback that it's called if the validator fails. In this case the instance of the validator is passed as parameter. You can use it, for instance, to generate a custom error payload:
The forth parameter contains the validator's messages (like the third parameter in Validator::make() or the controller's messages() method).
The last parameter can contain null, a Request object or an array. In the first case the current request() will be used otherwise the content passed will be validated. If the input parameter doesn't contain a valid value, an exception will be thrown.
All versions of validate-function with dependencies
illuminate/http Version >=5.5
illuminate/support Version >=5.5
laravel/helpers Version ^1.1