PHP code example of antriver / laravel-unique-email-validator
1. Go to this page and download the library: Download antriver/laravel-unique-email-validator library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
antriver / laravel-unique-email-validator example snippets
$this->validate(
$request,
[
// Check for other use of the same email address in the users.email column.
'email' => [new \Antriver\LaravelUniqueEmailValidator\UniqueEmailRule('users', 'email')],
]
);
$this->validate(
$request,
[
'email' => [new \Antriver\LaravelUniqueEmailValidator\UniqueEmailRule('users', 'email', ['id' => 123])],
// Where 123 is the 'id' of the existing user.
]
);