/data-validator-bundle

Primary LanguagePHPGNU General Public License v3.0GPL-3.0

Irontec Data Validation bundle for Symfony

Installation

Requirements / Tested on

  • PHP 8.0
  • Symfony 5.4

Add the Github VCS repository to project composer

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/irontec/data-validator-bundle"
    }
  ]
}

Add the dependency pointing to master branch

{
 "require": {
   "irontec/data-validator": "dev-master"
 }
}

Install the dependency

composer install

Usage

Add the required validations to entity properties using attributes

use Irontec\DataValidator\Validators\Dni\Dni;

class Person {

    #[Dni(['nullable' => true])]
    private ?string $dni;
}