$validator = Validator::make($request->all(), [
'email' => 'required|exists:users',
'password' => 'required|string'
]);
if ($validator->fails()) {
flash('Email Does Not Exists')->error();
// or
$request->session()->flash('message', 'Email Does Not Exists');
}
<?php
$email = "john.doe@example.com";
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
echo("$email is a valid email address");
} else {
echo("$email is not a valid email address");
}
?>