Skip to content

Commit ad1ff0d

Browse files
authored
Merge branch '1.x' into fix-validate-phone
2 parents c38ea62 + 625e1b9 commit ad1ff0d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+740
-58
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
custom: ['https://payping.ir/@milwad-dev']

.github/workflows/dependabot-auto-merge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
- name: Dependabot metadata
1515
id: metadata
16-
uses: dependabot/fetch-metadata@v1.4.0
16+
uses: dependabot/fetch-metadata@v1.6.0
1717
with:
1818
github-token: "${{ secrets.GITHUB_TOKEN }}"
1919
compat-lookup: true

.github/workflows/fix-php-code-style-issues.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
ref: ${{ github.head_ref }}
1616

1717
- name: Fix PHP code style issues
18-
uses: aglipanci/laravel-pint-action@2.2.0
18+
uses: aglipanci/laravel-pint-action@2.3.0
1919

2020
- name: Commit changes
2121
uses: stefanzweifel/git-auto-commit-action@v4

README.md

Lines changed: 69 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@
1010
[![Quality Score](https://img.shields.io/scrutinizer/g/milwad-dev/laravel-validate.svg?style=flat-square)](https://scrutinizer-ci.com/g/milwad-dev/laravel-validate)
1111

1212
***
13-
Laravel validate is a package for validate faster & easier. <br>
13+
Laravel validate is a package for validation faster & easier. <br>
1414
You can validate data easier, Laravel validate have lots of rule class for validation. <br>
15-
This package support localization and you can use for most of the language. <br>
15+
This package support localization and you can use it for most of the language. <br>
1616
(If some language didn't support, you can <a href="https://github.com/milwad-dev/laravel-validate/pulls">PR</a> for new language)
1717

1818
# Requirements
19+
1920
***
2021
- ```PHP >= 8.0```
2122
- ```Laravel >= 9.0```
@@ -29,20 +30,22 @@ This package support localization and you can use for most of the language. <br>
2930
| 1.7 | :x: | :x: | :x: | :white_check_mark: | :white_check_mark: |
3031

3132
# Installation
32-
You can install package with composer.
33+
34+
You can install the package with Composer.
3335

3436
```bash
3537
composer require milwad/laravel-validate
3638
```
3739

3840
# Publish
39-
If you want to publish lang file for custom validation message you can run this command in terminal:
41+
42+
If you want to publish a lang file for a custom validation message you can run this command in the terminal:
4043

4144
```shell
4245
php artisan vendor:publish --tag="validate-lang-{$lang}"
4346
```
4447

45-
You can replace `$lang` to your lang name, for ex:
48+
You can replace `$lang` with your lang name, for ex:
4649

4750
```shell
4851
php artisan vendor:publish --tag="validate-lang-en"
@@ -51,7 +54,8 @@ php artisan vendor:publish --tag="validate-lang-en"
5154
If you don't know about langs name you can go [Support Languages](#support-languages)
5255

5356
# Usage
54-
You can use `Laravel-Validate Rules` very simple.You can use `new` keyword before rule name.
57+
58+
You can use `Laravel-Validate Rules` very simply. You can use the `new` keyword before the rule name.
5559

5660
```php
5761
use Milwad\LaravelValidate\Rules\ValidPhoneNumber;
@@ -63,53 +67,53 @@ return [
6367

6468
# Rules
6569

66-
| # | Rule name | Usage |
67-
|-----|----------------------------|--------------------------------------------------------------------------|
68-
| 1 | ValidBitcoinAddress | Validate bitcoin address for ex (1KFHE7w8BhaENAswwryaoccDb6qcT6DbYY) |
69-
| 2 | ValidCapitalCharWithNumber | Validate String for ex (MILWAD-84) |
70-
| 3 | ValidDiscordUsername | Validate username discord for ex (Milwad#2134) |
71-
| 4 | ValidHashtag | Validate hashtag for ex (#milwad) |
72-
| 5 | ValidIpAddressIPV4 | Validate ip address IPV4 for ex (129.144.50.56) |
73-
| 6 | ValidIpAddressIPV6 | Validate ip address IPV6 for ex (2001:db8:3333:4444:5555:6666:7777:8888) |
74-
| 7 | ValidPhoneNumber | Validate phone number for ex (09366000000) |
75-
| 8 | ValidPort | Validate port value for ex (8080) |
76-
| 9 | ValidSlug | Validate slug for ex (milwad-dev) |
77-
| 10 | ValidImei | Validate imei phone for ex (354809104295874) |
78-
| 11 | ValidStrongPassword | Validate password for ex (Milwad123!) |
79-
| 12 | ValidUrl | Validate url for ex (https://www.google.com) |
80-
| 13 | ValidUsername | Validate username for ex (milwad) |
81-
| 14 | ValidUuid | Validate uuid for ex (123e4567-e89b-12d3-a456-426655440000) |
82-
| 15 | ValidHexColor | Validate hex color for ex (#fcba03) |
83-
| 16 | ValidHtmlTag | Validate html tags for ex (``<h1></h1>``) |
84-
| 17 | ValidNationalCard | Validate national card for ex (015016437) |
85-
| 18 | ValidCarNumber | Validate car number for ex (KA01AB1234) |
86-
| 19 | ValidNameDaysWeek | Validate day week for ex (monday) |
87-
| 20 | ValidEvenNumber | Validate number is even for ex (1024) |
88-
| 21 | ValidOddNumber | Validate number is odd for ex (4321) |
89-
| 22 | ValidSlashEndOfString | Validate write slash at the string for ex (milwad/) |
90-
| 23 | ValidCartNumberIran | Validate cart number for ex (1234123412341234) |
91-
| 24 | ValidBase64 | Validate base64 for ex (bWlsd2Fk) |
92-
| 25 | ValidJwt | Validate jwt |
93-
| 26 | ValidJalaliDate | Validate jajali date for ex (1384/8/25) |
94-
| 27 | ValidDuplicateCharacter | Validate duplicate characters for ex (1,2,3,4,5,6,7,8,9) |
95-
| 28 | ValidPattern | Validate texts with specific pattern 🔥 for ex (4444-4444-4444) |
96-
| 29 | ValidDuplicate | Validate duplicate string, numbers for ex (1123456) |
97-
| 30 | ValidUlid | Validate ulid for ex (01ARZ3NDEKTSV4RRFFQ69G5FAV) |
98-
| 31 | ValidDomain | Validate domain name for ex (github.com) |
99-
| 32 | ValidCamelCase | Validate camel case for ex (milwadDev) |
100-
| 33 | ValidPascalCase | Validate pascal case for ex (MilwadDev) |
101-
| 34 | ValidKebabCase | Validate kebab case for ex (milwad-dev) |
102-
| 35 | ValidSnakeCase | Validate snake case for ex (milwad_dev) |
103-
| 36 | ValidVatId | Validate european VAT ID ex (EL123456789123) |
104-
| 37 | ValidIban | Validate IBAN ex (IR062960000000100324200001) |
105-
| 38 | ValidIranPostalCode | Validate Iran postal code ex (3354355599) |
70+
| # | Rule name | Usage |
71+
|----|----------------------------|--------------------------------------------------------------------------|
72+
| 1 | ValidBitcoinAddress | Validate bitcoin address for ex (1KFHE7w8BhaENAswwryaoccDb6qcT6DbYY) |
73+
| 2 | ValidCapitalCharWithNumber | Validate String for ex (MILWAD-84) |
74+
| 3 | ValidDiscordUsername | Validate username discord for ex (Milwad#2134) |
75+
| 4 | ValidHashtag | Validate hashtag for ex (#milwad) |
76+
| 5 | ValidIpAddressIPV4 | Validate ip address IPV4 for ex (129.144.50.56) |
77+
| 6 | ValidIpAddressIPV6 | Validate ip address IPV6 for ex (2001:db8:3333:4444:5555:6666:7777:8888) |
78+
| 7 | ValidPhoneNumber | Validate phone number for ex (09366000000) |
79+
| 8 | ValidPort | Validate port value for ex (8080) |
80+
| 9 | ValidSlug | Validate slug for ex (milwad-dev) |
81+
| 10 | ValidImei | Validate imei phone for ex (354809104295874) |
82+
| 11 | ValidStrongPassword | Validate password for ex (Milwad123!) |
83+
| 12 | ValidUrl | Validate url for ex (https://www.google.com) |
84+
| 13 | ValidUsername | Validate username for ex (milwad) |
85+
| 14 | ValidUuid | Validate uuid for ex (123e4567-e89b-12d3-a456-426655440000) |
86+
| 15 | ValidHexColor | Validate hex color for ex (#fcba03) |
87+
| 16 | ValidHtmlTag | Validate html tags for ex (``<h1></h1>``) |
88+
| 17 | ValidNationalCard | Validate national card for ex (015016437) |
89+
| 18 | ValidCarNumber | Validate car number for ex (KA01AB1234) |
90+
| 19 | ValidNameDaysWeek | Validate day week for ex (monday) |
91+
| 20 | ValidEvenNumber | Validate number is even for ex (1024) |
92+
| 21 | ValidOddNumber | Validate number is odd for ex (4321) |
93+
| 22 | ValidSlashEndOfString | Validate write slash at the string for ex (milwad/) |
94+
| 23 | ValidCartNumberIran | Validate cart number for ex (1234123412341234) |
95+
| 24 | ValidBase64 | Validate base64 for ex (bWlsd2Fk) |
96+
| 25 | ValidJwt | Validate jwt |
97+
| 26 | ValidJalaliDate | Validate jalali date for ex (1384/8/25) |
98+
| 27 | ValidDuplicateCharacter | Validate duplicate characters for ex (1,2,3,4,5,6,7,8,9) |
99+
| 28 | ValidPattern | Validate texts with specific pattern 🔥 for ex (4444-4444-4444) |
100+
| 29 | ValidDuplicate | Validate duplicate string, numbers for ex (1123456) |
101+
| 30 | ValidUlid | Validate ulid for ex (01ARZ3NDEKTSV4RRFFQ69G5FAV) |
102+
| 31 | ValidDomain | Validate domain name for ex (github.com) |
103+
| 32 | ValidCamelCase | Validate camel case for ex (milwadDev) |
104+
| 33 | ValidPascalCase | Validate pascal case for ex (MilwadDev) |
105+
| 34 | ValidKebabCase | Validate kebab case for ex (milwad-dev) |
106+
| 35 | ValidSnakeCase | Validate snake case for ex (milwad_dev) |
107+
| 36 | ValidVatId | Validate european VAT ID ex (EL123456789123) |
108+
| 37 | ValidIban | Validate IBAN ex (IR062960000000100324200001) |
109+
| 38 | ValidIranPostalCode | Validate Iran postal code ex (3354355599) |
106110

107111
# Rules
108112

109113
### ValidPattern
110114

111-
Sometimes you need to validate text with pattern, For example you want to validate a text like (4444-4444-4444).
112-
If you want to check the length of text is seperator after `-` is 4, You can use this Rule:
115+
Sometimes you need to validate text with a pattern, For example, you want to validate a text like (4444-4444-4444).
116+
If you want to check the length of the text is separate after `-` is 4, You can use this Rule:
113117

114118
```php
115119
use Milwad\LaravelValidate\Rules\ValidPattern;
@@ -121,7 +125,7 @@ return [
121125

122126
### ValidIban
123127

124-
Sometimes you need to validate Iban(International Bank Account Number) code.You can use `ValidIban` rule:
128+
Sometimes you need to validate Iban(International Bank Account Number) code. You can use the `ValidIban` rule:
125129

126130
```php
127131
use Milwad\LaravelValidate\Rules\ValidIban;
@@ -131,7 +135,7 @@ return [
131135
];
132136
```
133137

134-
Also, You can use `Country` class and add a list of countries to `ValidIban` rule. By doing this your IBAN must belong
138+
Also, You can use the `Country` class and add a list of countries to the `ValidIban` rule. By doing this your IBAN must belong
135139
to one of the countries you pass to the validation class:
136140

137141
```php
@@ -168,16 +172,31 @@ Also, you can make <a href="https://github.com/milwad-dev/laravel-validate/pulls
168172
- [x] Russian (ru)
169173
- [x] Sinhala (si)
170174
- [x] Swedish (sv)
175+
- [x] Turkish (tr)
171176
- [x] Ukrainian (uk)
172177
- [x] Chinese (zh_CN)
173178

174179
# License
180+
175181
* This package is created and modified by <a href="https://github.com/milwad-dev" target="_blank">Milwad Khosravi</a> for Laravel upper more than 9 and is released under the MIT License.
176182

177183
# Contributing
184+
178185
This project exists thanks to all the people who contribute. [CONTRIBUTING](https://github.com/milwad-dev/laravel-validate/graphs/contributors)
179186

180187
<a href="https://github.com/milwad-dev/laravel-validate/graphs/contributors"><img src="https://opencollective.com/laravel-validate/contributors.svg?width=890&button=false" /></a>
181188

182189
# Security
190+
183191
If you've found a bug regarding security please mail [[email protected]](mailto:[email protected]) instead of using the issue tracker.
192+
193+
# Star History
194+
195+
[![Star History Chart](https://api.star-history.com/svg?repos=milwad-dev/laravel-validate&type=Date)](https://star-history.com/#milwad-dev/laravel-validate&Date)
196+
197+
# Donate
198+
199+
If this package is helpful for you, you can buy a coffee for me :) ❤️
200+
201+
Iranina Gateway: https://payping.ir/@milwad-dev
202+
Paypal Gateway: SOON

docs/1.x/all-rules.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Rules
2+
3+
| # | Rule name | Usage |
4+
|----|----------------------------|--------------------------------------------------------------------------|
5+
| 1 | ValidBitcoinAddress | Validate bitcoin address for ex (1KFHE7w8BhaENAswwryaoccDb6qcT6DbYY) |
6+
| 2 | ValidCapitalCharWithNumber | Validate String for ex (MILWAD-84) |
7+
| 3 | ValidDiscordUsername | Validate username discord for ex (Milwad#2134) |
8+
| 4 | ValidHashtag | Validate hashtag for ex (#milwad) |
9+
| 5 | ValidIpAddressIPV4 | Validate ip address IPV4 for ex (129.144.50.56) |
10+
| 6 | ValidIpAddressIPV6 | Validate ip address IPV6 for ex (2001:db8:3333:4444:5555:6666:7777:8888) |
11+
| 7 | ValidPhoneNumber | Validate phone number for ex (09366000000) |
12+
| 8 | ValidPort | Validate port value for ex (8080) |
13+
| 9 | ValidSlug | Validate slug for ex (milwad-dev) |
14+
| 10 | ValidImei | Validate imei phone for ex (354809104295874) |
15+
| 11 | ValidStrongPassword | Validate password for ex (Milwad123!) |
16+
| 12 | ValidUrl | Validate url for ex (https://www.google.com) |
17+
| 13 | ValidUsername | Validate username for ex (milwad) |
18+
| 14 | ValidUuid | Validate uuid for ex (123e4567-e89b-12d3-a456-426655440000) |
19+
| 15 | ValidHexColor | Validate hex color for ex (#fcba03) |
20+
| 16 | ValidHtmlTag | Validate html tags for ex (``<h1></h1>``) |
21+
| 17 | ValidNationalCard | Validate national card for ex (015016437) |
22+
| 18 | ValidCarNumber | Validate car number for ex (KA01AB1234) |
23+
| 19 | ValidNameDaysWeek | Validate day week for ex (monday) |
24+
| 20 | ValidEvenNumber | Validate number is even for ex (1024) |
25+
| 21 | ValidOddNumber | Validate number is odd for ex (4321) |
26+
| 22 | ValidSlashEndOfString | Validate write slash at the string for ex (milwad/) |
27+
| 23 | ValidCartNumberIran | Validate cart number for ex (1234123412341234) |
28+
| 24 | ValidBase64 | Validate base64 for ex (bWlsd2Fk) |
29+
| 25 | ValidJwt | Validate jwt |
30+
| 26 | ValidJalaliDate | Validate jajali date for ex (1384/8/25) |
31+
| 27 | ValidDuplicateCharacter | Validate duplicate characters for ex (1,2,3,4,5,6,7,8,9) |
32+
| 28 | ValidPattern | Validate texts with specific pattern 🔥 for ex (4444-4444-4444) |
33+
| 29 | ValidDuplicate | Validate duplicate string, numbers for ex (1123456) |
34+
| 30 | ValidUlid | Validate ulid for ex (01ARZ3NDEKTSV4RRFFQ69G5FAV) |
35+
| 31 | ValidDomain | Validate domain name for ex (github.com) |
36+
| 32 | ValidCamelCase | Validate camel case for ex (milwadDev) |
37+
| 33 | ValidPascalCase | Validate pascal case for ex (MilwadDev) |
38+
| 34 | ValidKebabCase | Validate kebab case for ex (milwad-dev) |
39+
| 35 | ValidSnakeCase | Validate snake case for ex (milwad_dev) |
40+
| 36 | ValidVatId | Validate european VAT ID ex (EL123456789123) |
41+
| 37 | ValidIban | Validate IBAN ex (IR062960000000100324200001) |
42+
| 38 | ValidIranPostalCode | Validate Iran postal code ex (3354355599) |

docs/1.x/contributing.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Contributing
2+
3+
This project exists thanks to all the people who
4+
contribute. [CONTRIBUTING](https://github.com/milwad-dev/laravel-validate/graphs/contributors)
5+
6+
<a href="https://github.com/milwad-dev/laravel-validate/graphs/contributors"><img src="https://opencollective.com/laravel-validate/contributors.svg?width=890&button=false" /></a>

docs/1.x/installation.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Requirements
2+
3+
***
4+
5+
- ```PHP >= 8.0```
6+
- ```Laravel >= 9.0```
7+
- ```Morilog-Jalali >= 3.x```
8+
9+
| GitHub | L6 | L7 | L8 | L9 | L10 |
10+
|--------|----|----|----|----|-----|
11+
| 1.5 ||||||
12+
| 1.6 ||||||
13+
| 1.7 ||||||
14+
15+
# Installation
16+
17+
You can install the package with Composer.
18+
19+
```bash
20+
composer require milwad/laravel-validate
21+
```
22+
23+
# Publish
24+
25+
If you want to publish a lang file for a custom validation message you can run this command in the terminal:
26+
27+
```shell
28+
php artisan vendor:publish --tag="validate-lang-{$lang}"
29+
```
30+
31+
You can replace `$lang` with your lang name, for ex:
32+
33+
```shell
34+
php artisan vendor:publish --tag="validate-lang-en"
35+
```
36+
37+
If you don't know about langs name you can go [Support Languages](#support-languages)

0 commit comments

Comments
 (0)