Skip to content

Commit 8a94e37

Browse files
committed
file logger fix
1 parent 17aa838 commit 8a94e37

File tree

1 file changed

+59
-38
lines changed

1 file changed

+59
-38
lines changed

docs/validation.md

Lines changed: 59 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -257,41 +257,62 @@ Below is a list of possible error messages returned by validators:
257257

258258
### Non-Database Validators (Validators)
259259

260-
| Validator | Possible Error Message |
261-
|-------------------|--------------------------------------------|
262-
| `text` | `the text cannot contains html fields` |
263-
| `name` | `is not valid name` |
264-
| `alpha` | `is not alpha` |
265-
| `latin` | `is not latin` |
266-
| `digit` | `invalid digit value` |
267-
| `alphanumeric` | `is not alpha` |
268-
| `required` | `is required` |
269-
| `email` | `invalid email` |
270-
| `regex(...)` | `format is not valid` |
271-
| `len<, len>, ...` | `is too long` / `is too short` |
272-
| Numeric comparisons | `is bigger than` / `is smaller than` |
273-
| `int`, `+int` | `invalid integer` |
274-
| `float`, `+float` | `invalid integer` |
275-
| `password` | `password is not complex enough` |
276-
| `domain` | `invalid domain` |
277-
| `url` | `invalid URL` |
278-
| `ip`, `ip4`, `ip6`| `value must be valid IPv4/IPv6 address` |
279-
| `cidr` | `value must be valid CIDR notation` |
280-
| `mac` | `value must be valid MAC address` |
281-
| `date` | `invalid date, date expected be in RFC3339 format` |
282-
| `longitude` | `value must be valid longitude` |
283-
| `latitude` | `value must be valid latitude` |
284-
| `port` | `value must be valid port number` |
285-
| `json` | `value must be valid JSON format` |
286-
| `uuid` | `value must be valid uuid` |
287-
288-
### Database Validators (DBValidators)
289-
290-
| Validator | Possible Error Message |
291-
|---------------------|-------------------------------------------------|
292-
| `unique` | `duplicate entry` |
293-
| `unique:col1\|col2` | `duplicate value for <columns>` |
294-
| `fk` | `value does not match foreign key` |
295-
| `enum` | `invalid value, expected values are: <values>` |
296-
| `before(field)` | `<field> must be before <other field>` |
297-
| `after(field)` | `<field> must be after <other field>` |
260+
| Validator | Description | Error Message |
261+
|----------------------|------------------------------------------------|---------------------------------------------------------------|
262+
| `text` | Ensures string contains no HTML tags. | `the text cannot contains html fields` |
263+
| `name` | Checks if the value is a valid name. | `is not valid name` |
264+
| `alpha` | Only alphabetical characters allowed. | `is not alpha` |
265+
| `latin` | Only Unicode letters allowed. | `is not latin` |
266+
| `digit` | Only digits [0-9] allowed. | `invalid digit value` |
267+
| `alphanumeric` | Letters, digits, and spaces allowed. | `is not alpha` |
268+
| `required` | Value cannot be empty. | `is required` |
269+
| `email` | Checks for valid email format. | `invalid email` |
270+
| `regex(...)` | Matches value against a regex pattern. | `format is not valid` |
271+
| `len<, len>, ...` | Ensures string length within constraints. | `is too short` / `is too long` / `is not equal to <length>` |
272+
| Numeric comparisons | Compares numeric values (`>`, `<`, etc.). | `is bigger than ...` / `is smaller than ...` |
273+
| `int`, `+int`, `-int`| Checks if the value is integer. | `invalid integer` |
274+
| `float`, `+float`, `-float` | Checks if the value is float. | `invalid integer` |
275+
| `password(...)` | Checks password complexity. | `password is not complex enough` |
276+
| `domain` | Valid domain format. | `invalid domain` |
277+
| `url` | Valid URL format. | `invalid URL` |
278+
| `ip`, `ip4`, `ip6` | Valid IP address (IPv4 or IPv6). | `value must be valid IPv4/IPv6 address` |
279+
| `cidr` | Valid CIDR notation. | `value must be valid CIDR notation` |
280+
| `mac` | Valid MAC address. | `value must be valid MAC address` |
281+
| `date` | Valid RFC3339 date. | `invalid date, date expected be in RFC3339 format` |
282+
| `longitude` | Valid longitude. | `value must be valid longitude` |
283+
| `latitude` | Valid latitude. | `value must be valid latitude` |
284+
| `port` | Valid port number. | `value must be valid port number` |
285+
| `json` | Valid JSON format. | `value must be valid JSON format` |
286+
| `ISBN`, `ISBN10`, `ISBN13` | Valid ISBN format. | `value must be ISBN-10 format` / `value must be ISBN-13 format` |
287+
| `creditcard` | Valid credit card number. | `value must be credit card number` |
288+
| `uuid` | Valid UUID. | `value must be valid uuid` |
289+
| `uppercase` | Ensures string is uppercase. | `value must be in upper case` |
290+
| `lowercase` | Ensures string is lowercase. | `value must be in lower case` |
291+
| `rgbcolor`, `rgba`, `hexcolor`, `hex` | Validates color formats. | `value must be HEX color` / `value must be RGB color` |
292+
| `countryalpha2`, `countryalpha3` | Valid ISO country codes. | `value must be a valid ISO3166 Alpha 2/3 Format` |
293+
| `btcaddress` | Valid Bitcoin address. | `value must be a valid Bitcoin address` |
294+
| `ethaddress` | Valid Ethereum address. | `value must be a valid ETH address` |
295+
| `cron` | Valid CRON expression. | `value must be a valid CRON format` |
296+
| `duration` | Valid Go duration format. | `value must be a valid duration format` |
297+
| `time` | Valid RFC3339 timestamp. | `value must be a valid RFC3339 timestamp` |
298+
| `unixTimestamp` | Valid Unix timestamp. | `value must be a valid unix timestamp` |
299+
| `timezone` | Valid timezone string. | `value must be a valid timezone` |
300+
| `e164` | Valid E164 phone number. | `value must be a valid E164 phone number` |
301+
| `safeHTML` | Ensures string does not contain XSS tokens. | `value must not contain any possible XSS tokens` |
302+
| `noHTML` | Ensures string does not contain HTML tags. | `value must not contain any html tags` |
303+
| `phone` | Valid phone number format. | `value must be valid phone number` |
304+
305+
---
306+
307+
## Database-Related Validators
308+
309+
These validators validate input against database constraints.
310+
311+
| Validator | Description | Possible Error Message |
312+
|---------------------|-------------------------------------------------------|----------------------------------------------------------|
313+
| `unique` | Ensures the field value is unique in the table. | `duplicate entry` |
314+
| `unique:col1\|col2` | Ensures a combination of columns is unique. | `duplicate value for <columns>` |
315+
| `fk` | Validates foreign key references another table. | `value does not match foreign key` |
316+
| `enum` | Ensures value matches an allowed ENUM value. | `invalid value, expected values are: ...` |
317+
| `before(field)` | Ensures timestamp is before another field’s value. | `<field> must be before <other field>` |
318+
| `after(field)` | Ensures timestamp is after another field’s value. | `<field> must be after <other field>` |

0 commit comments

Comments
 (0)