Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to validate a email address domain in Laravel?

In Laravel, how do I validate an email address and force it to have a suffix like g.go.edu?

like image 290
Witairsturs Avatar asked Apr 18 '15 17:04

Witairsturs


People also ask

What is DNSCheckValidation?

DNSCheckValidation: Will check if there are DNS records that signal that the server accepts emails.


Video Answer


1 Answers

If you want to accept all emails that have suffix g.go.edu, you can use as rule both email and regex rules, for example:

$rules['email'] = ['email', 'regex:/(.*)g\.go\.edu$/i'];
like image 194
Marcin Nabiałek Avatar answered Nov 03 '22 15:11

Marcin Nabiałek