| 12345678910111213141516171819202122232425262728 |
- <?php
- namespace App\Module\User\Validator;
- use App\Module\User\Models\User;
- use UCore\Validator;
- /**
- * 用户邮箱是否 不存在true
- *
- */
- class UserEmailValidator extends Validator
- {
- public function validate(mixed $value, array $data): bool
- {
- // dd($value);
- $user = User::query()->where('email', $value)->first();
- if ($user) {
- return false;
- }
- return true;
- }
- }
|