Download the PHP package krazydanny/laravel-validator without Composer
On this page you can find all versions of the php package krazydanny/laravel-validator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download krazydanny/laravel-validator
More information about krazydanny/laravel-validator
Files in krazydanny/laravel-validator
Package laravel-validator
Short Description An Extended Laravel Validator with many useful additional rules!
License MIT
Informations about the package laravel-validator
Laravel Extended Validator
This package provides an Extended Laravel Validator with many useful additional rules!
- Laravel Excended Validator
- Main Advantages
- Time-Saving
- Exclusive validation rules
- Installation
- Laravel version Compatibility
- Lumen version Compatibility
- Install the package via Composer
- Usage
- Rules
- Main Advantages
Main Advantages
Time-Saving
Extends Laravel's great built-in validator with commonly used validation rules avoiding you to search the internet for "the golden regex" and extending validator yourself :)
Just register the service provider and rules are ready to use!
Excusive validation rules
Some hard-to-find validation rules available for you as if they where included in Laravel.
Installation
The only requirement is to have a Laravel or Lumen project. I asume your are already familiar with one of them, otherwise here are some docs about this great framework:
- Laravel -> https://laravel.com
- Lumen -> https://lumen.laravel.com
Laravel version Compatibility
Laravel | Package |
---|---|
5.6.x | 1.0.4 |
5.7.x | 1.0.4 |
5.8.x | 1.0.4 |
6.x | 1.0.4 |
7.x | 1.0.4 |
Lumen version Compatibility
Lumen | Package |
---|---|
5.6.x | 1.0.4 |
5.7.x | 1.0.4 |
5.8.x | 1.0.4 |
6.x | 1.0.4 |
7.x | 1.0.4 |
Install the package via Composer
Usage
We only have to register the service provider in our project and all new rules are ready to use :)
For example:
Rules
Here's a list of all available validation rules:
- array_of_regex
- alpha_blank
- boolean_strict
- camel_case
- color_hex
- date_gt_max
- date_gt_min
- date_lt_max
- date_lt_min
- document_number
- float
- geo_distance
- kebab_case
- latitude
- longitude
- mac_address
- object
- pascal_case
- snake_case
array_of_regex
Iterates array values verifying each element matches a given regular expression.
Synthax:
array_of_regex
MATCH examples:
NO MATCH examples:
boolean_strict
Checks if value's data type is strictly bool.
Synthax:
boolean_strict
MATCH examples:
NO MATCH examples:
camel_case
Checks if value is a string formatted using camelCase notation.
Synthax:
camel_case
MATCH examples:
NO MATCH examples:
color_hex
Checks if a string represents a hexadecimal color code.
Synthax:
color_hex
MATCH examples:
NO MATCH examples:
date_gt_min
Checks if a date (value) is greater than another date (first parameter) at least by the given seconds (second parameter).
Third parameter (optional) could be date's (value) format.
Synthax:
date_gt_min:lower_date,diff_in_seconds,format
date_gt_max
Checks if a date (value) is greater than another date (first parameter) by the given seconds as much (second parameter).
Third parameter (optional) could be date's (value) format.
Synthax:
date_gt_max:lower_date,diff_in_seconds,format
date_lt_min
Checks if a date (value) is lower than another date (first parameter) at least by the given seconds (second parameter).
Third parameter (optional) could be date's (value) format.
Synthax:
date_lt_min:greater_date,diff_in_seconds,format
date_lt_max
Checks if a date (value) is lower than another date (first parameter) by the given seconds as much (second parameter).
Third parameter (optional) could be date's (value) format.
Synthax:
date_lt_max:greater_date,diff_in_seconds,format
document_number
Checks if value is a valid reference number for any kind of document or paper.
Synthax:
MATCH examples:
NO MATCH examples:
float
Checks if value is a floating point number. With the 'strict' parameter also checks the data type.
Synthax:
MATCH examples:
NO MATCH examples:
geo_distance
Checks if value is an integer representing "earth distance". Value can specify the following units at the end of the value: "km" or "m"
Synthax:
MATCH examples:
NO MATCH examples:
kebab_case
Checks if value is a string formatted using kebab-case notation.
Synthax:
kebab_case
MATCH examples:
NO MATCH examples:
latitude
Checks if value is valid latitude (between 90 and -90 degrees).
Synthax:
latitude
MATCH examples:
NO MATCH examples:
longitude
Checks if value is valid longitude (between 180 and -180 degrees).
Synthax:
longitude
MATCH examples:
NO MATCH examples:
mac_address
Checks if value is a valid IEEE 802 MAC Address.
Synthax:
mac_address
MATCH examples:
NO MATCH examples:
object
Checks if value is an object or an array representing an object.
Synthax:
object
MATCH examples:
NO MATCH examples:
pascal_case
Checks if value is a string formatted using PascalCase notation.
Synthax:
pascal_case
MATCH examples:
NO MATCH examples:
snake_case
Checks if value is a string formatted using snake_case notation.
Synthax:
snake_case
MATCH examples:
NO MATCH examples:
'Snake_case'
'snake_Case'
'snake_CaseNotation'
'N_snake_case'
'snake_caseN'
'snake_case_N'