You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+49Lines changed: 49 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,7 @@ offering an easy-to-use and intuitive API to validate user input or other data i
21
21
## Table of Contents
22
22
23
23
-[Installation](#installation)
24
+
-[When to use it](#when-to-use-it)
24
25
-[Usage](#usage)
25
26
-[Constraints](#constraints)
26
27
-[Methods](#methods)
@@ -46,6 +47,13 @@ Install via [Composer](https://getcomposer.org/):
46
47
composer require programmatordev/fluent-validator
47
48
```
48
49
50
+
## When to use it
51
+
52
+
Use Fluent Validator when you want Symfony Validator constraints for raw values without setting up object metadata, attributes, forms, or a larger validation layer.
53
+
It is useful for small input checks, command arguments, request fragments, webhook payload values, configuration values, and library code.
54
+
55
+
This package does not replace Symfony Validator. It wraps Symfony Validator and keeps its constraints, violation objects, groups, translations, and custom constraint model.
56
+
49
57
## Usage
50
58
51
59
Simple usage example:
@@ -64,7 +72,33 @@ if ($errors->count() > 0) {
64
72
}
65
73
```
66
74
75
+
Use `assert` when invalid values should stop the current flow:
76
+
77
+
```php
78
+
use ProgrammatorDev\FluentValidator\Exception\ValidationFailedException;
0 commit comments