Validate the domain of an email with Laravel validation

Assuming you want to restrict email to a single domain, you can try this validation as well.

$validatedData = $request->validate(, ]);

Remember that when you use regular expression validation in Laravel you have to put the different validation rules in array notation, instead of concatenating the rules using pipes or “|” pipes.

So you can validate the email domain, but we are also validating the email itself with the “email” rule.

See also  Creating graphs in PHP with JpGraph
Loading Facebook Comments ...
Loading Disqus Comments ...