A simple, elegant, stand-alone validation library for PHP with no dependencies.
Valitron is a lightweight, stand-alone validation library for PHP that focuses on readable syntax and ease of use. It validates arrays, form data, and nested structures without external dependencies, avoiding the bloat of other libraries. It provides over 40 built-in rules, custom rule creation, and flexible error messaging.
PHP developers building web applications, APIs, or any system requiring data validation, especially those prioritizing minimal dependencies and clean, maintainable code. It suits projects where validating form submissions, API payloads, or configuration arrays is needed.
Developers choose Valitron for its dependency-free design, avoiding unnecessary files from frameworks like Symfony's HttpFoundation. Its concise, chainable syntax and pragmatic approach offer everything needed for validation without extra complexity, making it a straightforward alternative to heavier libraries.
Valitron is a simple, elegant, stand-alone validation library with NO dependencies
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Valitron is completely stand-alone with no external libraries, avoiding bloat from frameworks like Symfony's HttpFoundation and keeping the codebase minimal, as emphasized in the 'Why Valitron?' section.
Uses simple, chainable methods and dot-notation for nested arrays, making validation rules concise and easy to understand, shown in examples like validating 'settings.*.threshold'.
Includes over 40 built-in rules covering common needs such as email, date, creditCard, and conditional logic like requiredWith, reducing the need for custom code.
Allows adding custom validation logic via closures using the addRule method, enabling flexible, project-specific validations without extending the library.
Validates arrays only, requiring manual conversion for object-oriented data structures, unlike some validation libraries that work directly with objects or entities.
Doesn't integrate natively with popular PHP frameworks, which may lead to redundant validation layers or compatibility issues in ecosystem-heavy projects.
Lacks built-in rules for database checks like uniqueness or existence, necessitating separate queries and additional logic outside the validation layer.