PHP code example of wamesk / laravel-validator

1. Go to this page and download the library: Download wamesk/laravel-validator library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wamesk / laravel-validator example snippets


$data = ['email' => '[email protected]', 'password' => 'password'];

$validator = Validator::validate($data, [
    'email' => 'email|

$data = ['email' => '[email protected]', 'password' => 'password'];

$validator = Validator::code('1.2')->validate($data, [
    'email' => 'email|

$data = ['email' => '[email protected]', 'password' => 'password'];

$validator = Validator::code('1.2')
    ->messages([
        'email.or) return $validator;

Validator::statusCode($statusCode)->code($code)->messages($messages)->validate($data, $rules);

Validator::code($code)->validate($data, [
    'id' => [
        new Exists(User::class),
    ]
]);

new \Wame\Validator\Rules\Exists(User::class, 'id')

new \Wame\Validator\Rules\IsInteger(min: 10, max: 100)

new \Wame\Validator\Rules\IsString(min: 10, max: 100)

new \Wame\Validator\Rules\IsString(min: 10, max: 100)

new \Wame\Validator\Rules\IsEmail(domainMustExist: false, disableTempMail: false)
bash
php artisan vendor:publish --provider="Wame\Validator\LaravelValidatorServiceProvider" --tag="translations"