<?php
use Illuminate\Validation\Validator;
use Illuminate\Translation\Translator;
use Illuminate\Translation\FileLoader;
use Illuminate\Filesystem\Filesystem;
$filesystem = new Filesystem();
$loader = new FileLoader($filesystem, '');
$translator = new Translator($loader, 'us');
$data = [
'age' => 22,
'name' => 'John',
'email' => 'john@doe.com',
];
$rules = [
'age' => 'required|Integer|min:18',
'name' => 'required|alpha',
'email' => 'email',
];
$validator = new Validator(
$translator,
$data,
$rules
);
$hasPassed = $validator->passes();
dump($hasPassed);