PHP code example of wuori / laravel-unique-gmail-validation
1. Go to this page and download the library: Download wuori/laravel-unique-gmail-validation 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/ */
wuori / laravel-unique-gmail-validation example snippets
...
use Illuminate\Http\Request;
use Wuori\UniqueGmail\UniqueGmail;
...
// default User model
$validator = $request->validate([
'email' => [new UniqueGmail()]
]);
// custom model
$validator = $request->validate([
'email' => [new UniqueGmail(\App\Models\Customers::class)]
]);
// combined with other rules
$validator = $request->validate([
'email' => ['
$options = [
'message' => 'An account already exists for :existing_email, a varient of :requested_email.'
];
$validator = $request->validate([
'email' => [new UniqueGmail(\App\Models\User::class, $options)]
]);