问题
In Laravel, how do I validate an email address and force it to have a suffix like g.go.edu
?
回答1:
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'];
来源:https://stackoverflow.com/questions/29720750/how-to-validate-a-email-address-domain-in-laravel