I am using Laravel 5.4 and want to validate unique alternate email.
$this->validate($request, [
'alternate' => 'required',
'email',
'unique:users,alternate_email']);
// tried as well to specify db "unique:pgsql.users,alternate_email"
The value for your field key should be an array, something like:
$this->validate($request, [
'alternate' => [
'required',
'email',
'unique:users,alternate_email'
]
]);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With