Build your first rule
Install Fynix and learn the v3 workflow in the introduction guide.
Fynix is a framework-agnostic PHP validation engine for rules that stay readable as your application grows. Build a rule with the Rule facade, compose it with fluent constraints, and return the same structured errors from a field, DTO, or nested object graph.
use Fynix\Rule;
$email = Rule::email('email') ->required() ->max(180);
$error = $email->validate('not-an-email');Rules are immutable, chainable, and built through the public facade. Use the same fluent language for a one-off value or a complete DTO.
use Fynix\RuleSet;use Fynix\ValidationHandler;use Fynix\ValidationRegistry;
final class User{ public string $firstName = ''; public string $email = '';}
ValidationRegistry::register( User::class, static fn (RuleSet $rules): array => [ $rules->string('firstName')->min(2)->max(50), $rules->email('email')->max(180), ]);
$user = new User();$user->firstName = 'A';$user->email = 'not-an-email';
$errors = ValidationHandler::validate($user);The handler preserves nested error structure for APIs and can return string messages for forms. No framework adapter is required.
Build your first rule
Install Fynix and learn the v3 workflow in the introduction guide.
Use the public API
Learn Rule, RuleSet, the fluent API, and object validation in the public API reference.
Choose a validator
Find practical examples for every validator in the validator examples.
Copy a recipe
Start from a complete scenario in the validation recipes, from conditional fields to nested DTOs.