| Package Data | |
|---|---|
| Maintainer Username: | cretueusebiu |
| Maintainer Contact: | cretu.eusebiu@gmail.com (Cretu Eusebiu) |
| Package Create Date: | 2015-08-03 |
| Package Last Update: | 2017-10-20 |
| Home Page: | |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-10-28 03:03:04 |
| Package Statistics | |
|---|---|
| Total Downloads: | 384 |
| Monthly Downloads: | 0 |
| Daily Downloads: | 0 |
| Total Stars: | 2 |
| Total Watchers: | 2 |
| Total Forks: | 3 |
| Total Open Issues: | 3 |
composer require illuminate/validation
composer require hazzard/validation
use Hazzard\Validation\Validator;
$validator = new Validator;
// Set default language lines used by the translator.
$validator->setDefaultLines();
// Make instance available globally via static methods (optional).
$validator->setAsGlobal();
// Create a class alias (optional).
$validator->classAlias();
Using the Illuminate Database Capsule set the database connection instance:
$db = $capsule->getDatabaseManager();
$validator->setConnection($db);
To provide a custom translator pass an instance of Illuminate\Container\Container with the translator bound to translator.
The translator must implement Symfony\Component\Translation\TranslatorInterface.
$container['translator'] = new CustomTranslator();
$validator = new Validator($container);
$validator = Validator::make(
['name' => 'Dayle'],
['name' => 'required|min:5']
);
The rest is the same as Laravel.