Closed henriquemoody closed 5 years ago
In order to make simple validations even shorter, create the classes: Assert, Check, and IsValid.
Assert
Check
IsValid
Usage examples:
// Validator::email()->validate($input) IsValid::email($input); // Validator::not(Validator::email())->validate($input) IsValid::notEmail($input); // Validator::email()->assert($input) Assert::email($input); // Validator::not(Validator::email())->assert($input) Assert::notEmail($input); // Validator::assert() with custom template Assert::email($input, 'Template message with {{input}}'); // Validator::email()->check($input) Check::email($input); // Validator::not(Validator::email())->check($input) Check::notEmail($input); // Validator::check() with custom template Check::email($input, 'Template message with {{input}}'); // Validator::check() against multiple inputs Check::emailAll($input); Check::emailAny($input); Check::emailNone($input);
still relevant ?
No, I created Assertion to do some of it. For the rest, I think they would make more sense outside this library.
Thanks for bringing my attention to it! 🐼
In order to make simple validations even shorter, create the classes:
Assert
,Check
, andIsValid
.Usage examples: