Skip to content

Commit 5723954

Browse files
committed
wip
1 parent 9cf60b0 commit 5723954

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

validation.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,16 +1226,30 @@ The example above will apply the `RFCValidation` and `DNSCheckValidation` valida
12261226

12271227
<div class="content-list" markdown="1">
12281228

1229-
- `rfc`: `RFCValidation`
1230-
- `strict`: `NoRFCWarningsValidation`
1231-
- `dns`: `DNSCheckValidation`
1232-
- `spoof`: `SpoofCheckValidation`
1233-
- `filter`: `FilterEmailValidation`
1234-
- `filter_unicode`: `FilterEmailValidation::unicode()`
1229+
- `rfc`: `RFCValidation` - Validate the email address according to RFC 5322.
1230+
- `strict`: `NoRFCWarningsValidation` - Validate the email according to RFC 5322, rejecting trailing periods or multiple consecutive periods.
1231+
- `dns`: `DNSCheckValidation` - Ensure the email address's domain has a valid MX record.
1232+
- `spoof`: `SpoofCheckValidation` - Ensure the email address does not contain homograph or deceptive Unicode characters.
1233+
- `filter`: `FilterEmailValidation` - Ensure the email address is valid according to PHP's `filter_var` function.
1234+
- `filter_unicode`: `FilterEmailValidation::unicode()` - Ensure the email address is valid according to PHP's `filter_var` function, allowing some Unicode characters.
12351235

12361236
</div>
12371237

1238-
The `filter` validator, which uses PHP's `filter_var` function, ships with Laravel and was Laravel's default email validation behavior prior to Laravel version 5.8.
1238+
For convenience, email validation rules may be built using the fluent rule builder:
1239+
1240+
```php
1241+
use Illuminate\Validation\Rule;
1242+
1243+
$request->validate([
1244+
'email' => [
1245+
'required',
1246+
Rule::email()
1247+
->rfcCompliant(strict: false)
1248+
->validateMxRecord()
1249+
->preventSpoofing()
1250+
],
1251+
]);
1252+
```
12391253

12401254
> [!WARNING]
12411255
> The `dns` and `spoof` validators require the PHP `intl` extension.

0 commit comments

Comments
 (0)