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
The package provides below configuration options in `config/persian-validation.php`:
46
44
47
-
-`register_rules` (default: `true`):
48
-
Enables using the validation rules directly in Laravel's validation syntax. When enabled, you can use rules like:
49
-
```php
45
+
-`register_rules` (default: `true`):
46
+
Enables using the validation rules directly in Laravel's validation syntax. When enabled, you can use rules like:
47
+
`php
50
48
'field' => 'required|persian_alpha'
51
-
```
49
+
`
52
50
53
-
-`accept_persian_numbers` (default: `false`):
54
-
Determines whether Persian numbers are accepted alongside English numbers in validation rules that involve numbers. When disabled, only English numbers will be accepted.
51
+
-`accept_persian_numbers` (default: `false`):
52
+
Determines whether Persian numbers are accepted alongside English numbers in validation rules that involve numbers. When disabled, only English numbers will be accepted.
|`persian_alpha`| Persian alphabetic characters with diacritics, spaces & ZWNJ (حروف فارسی و علائم نگارشی و فاصله و نیم فاصله) | - | سلام، علیرضا | Hello, Test |
108
106
|`persian_alpha_num`| Persian alphabetic with diacritics, spaces, ZWNJ & Persian numbers (حروف فارسی و علائم نگارشی و فاصله و اعداد فارسی) |`convertPersianNumbers`| سلام۱۲۳، علیرضا۴۵۶ | Hello 123, Test |
109
107
|`persian_alpha_eng_num`| Persian alphabetic with diacritics, spaces, ZWNJ, Persian & English numbers (حروف فارسی و علائم نگارشی و فاصله و اعداد فارسی و انگلیسی) |`convertPersianNumbers`| سلام123، علیرضا۴۵۶ | Hello 123, Test |
@@ -112,13 +110,13 @@ $rules = [
112
110
113
111
#### Parameters Details
114
112
115
-
-`convertPersianNumbers` is a boolean parameter that converts Persian numbers to English numbers.
116
-
the default is `false`.
113
+
-`convertPersianNumbers` is a boolean parameter that converts Persian numbers to English numbers.
|`persian_date_between`| Validates date is between two Shamsi dates (تاریخ مابین دو تاریخ شمسی) |`startDate`, `endDate`, `separator`, `convertPersianNumbers`| 1403/01/01 (if between range) | 1402/12/29 (if outside range) |
124
122
|`persian_date_between_or_equal`| Validates date is between or equal to two Shamsi dates (تاریخ مابین یا برابر با دو تاریخ شمسی) |`startDate`, `endDate`, `separator`, `convertPersianNumbers`| 1403/01/01 (if between range) | 1402/12/29 (if outside range) |
@@ -133,101 +131,96 @@ $rules = [
133
131
134
132
#### Parameters Details
135
133
136
-
-`convertPersianNumbers` is a boolean parameter that converts Persian numbers to English numbers.
137
-
the default is `false`.
138
-
139
-
140
-
-`separator` is a string parameter that separates the numbers in the validation rules.
141
-
the default is `/`. (Allows: `/`, `|`, `-`, `_`, `*`, `.`, `,`, `space`)
142
-
134
+
-`convertPersianNumbers` is a boolean parameter that converts Persian numbers to English numbers.
135
+
the default is `false`.
143
136
144
-
-`startDate` and `endDate` are **required** parameters and are Shamsi dates that are used to validate the date is between them and using the `separator`.
137
+
-`separator` is a string parameter that separates the numbers in the validation rules.
138
+
the default is `/`. (Allows: `/`, `|`, `-`, `_`, `*`, `.`, `,`, `space`)
145
139
140
+
-`startDate` and `endDate` are **required** parameters and are Shamsi dates that are used to validate the date is between them and using the `separator`.
146
141
147
-
-`startYear` and `endYear` are **required** parameters and are Shamsi years that are used to validate the year is between them and the 4-digit acceptable.
142
+
-`startYear` and `endYear` are **required** parameters and are Shamsi years that are used to validate the year is between them and the 4-digit acceptable.
<br>**Note:** When use the `withCountryCodeFormat` parameter, the `withAreaCode`is required and set it to `true` and the `areaCodeSeparator` parameter will be ignored.
173
+
-`withCountryCodeFormat` is a string parameter that validate the phone with should include country code and area code.
174
+
the default is `null`. (Allows: `zero`, `plus`, `normal`, `all`)
<br>**Note:** When use the `withCountryCodeFormat` parameter, the `withAreaCode`is required and set it to `true` and the `areaCodeSeparator` parameter will be ignored.
-`convertPersianNumbers` is a boolean parameter that converts Persian numbers to English numbers.
227
-
the default is `false`.
218
+
-`convertPersianNumbers` is a boolean parameter that converts Persian numbers to English numbers.
219
+
the default is `false`.
228
220
229
-
-`separator` is a string parameter that separates the numbers in the validation rules.
230
-
the default is `null`, and means does not use separator. (Allows: `/`, `|`, `-`, `_`, `*`, `.`, `,`, `space`)
221
+
-`separator` is a string parameter that separates the numbers in the validation rules.
222
+
the default is `null`, and means does not use separator. (Allows: `/`, `|`, `-`, `_`, `*`, `.`, `,`, `space`)
231
223
232
224
## License
225
+
233
226
The Laravel Persian Validation package is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT). Please see [License File](LICENSE.md) for more information.
0 commit comments