In previous versions of Laravel, I remember only emails like
[email protected]will pass the Validation.
Now emails likename@domainare valid ?
Route::get('/', function () {
$request = [
'field' => 'n@d', // invalid email address
];
$validator = Validator::make($request, [
'field' => 'email',
]);
if ($validator->fails()) {
// We need to reach this point and the validation need to fail.
dd('VALIDATION FAILS');
}
// Unfortunately the validation passes :(
return 'VALIDATION PASSES';
});
That is a valid email
This is a valid email address. Please see https://github.com/laravel/framework/issues/28233, https://github.com/laravel/framework/issues/27875 and other issues.
OK. I see.
One email address don't need to have a TLD to be valid... new stuff.
For those still having issues with this, use this 'email' => 'email:filter' which uses the filter_var() method under the hood to check if the email is valid. Refer to https://laravel.com/docs/5.8/validation#rule-email for other email validation types .
Most helpful comment
For those still having issues with this, use this 'email' => 'email:filter' which uses the filter_var() method under the hood to check if the email is valid. Refer to https://laravel.com/docs/5.8/validation#rule-email for other email validation types .