LaravelPackages.net
Acme Inc.
Toggle sidebar
yandjin/custom-validation

small and simple validation package inspired by laravel validation, no dependencies

4
0
v1.0
About yandjin/custom-validation

yandjin/custom-validation is a Laravel package for small and simple validation package inspired by laravel validation, no dependencies. It currently has 0 GitHub stars and 4 downloads on Packagist (latest version v1.0). Install it with composer require yandjin/custom-validation. Discover more Laravel packages by yandjin or browse all Laravel packages to compare alternatives.

Last updated

Small and simple validation package inspired by laravel validation, no dependencies

how to install :

composer require yandjin/custom-validation

how to use

use the following namespace :

use YanDjin\Validation\CustomValidation;

the validation returns true or false :

$arrayOfData = [
    "name" => "YanDjin",
    "age" => 26
];

if(!CustomValidation::validateData($arrayOfData, [
    "name" => "characters",
    "age" => "numeric|min:18" // pipe the validation rules (: for parameters ) or use array "age" => ["numeric", "min" => 18]
]) {
    // returns the fields not passing the validation and the errors
    return CustomValidation::getErrorsMessagesAsString();
}

Star History Chart