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
-`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.
1235
1235
1236
1236
</div>
1237
1237
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
+
```
1239
1253
1240
1254
> [!WARNING]
1241
1255
> The `dns` and `spoof` validators require the PHP `intl` extension.
0 commit comments