laravel validate email of user editing email code example
Example 1: laravel using username instead of email
All we need is add a method in app/Http/Controllers/Auth/LoginController.php:
/**
* Get the login username to be used by the controller.
*
* @return string
*/
public function username()
{
return 'username';
}
Example 2: laravel check if email is real
<?php
$email = "[email protected]";
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
echo("$email is a valid email address");
} else {
echo("$email is not a valid email address");
}
?>