承接 antriver/laravel-unique-email-validator 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

antriver/laravel-unique-email-validator

Composer 安装命令:

composer require antriver/laravel-unique-email-validator

包简介

Laravel validation rule to check an email address is really unique.

README 文档

README

This provides a Laravel validation rule that improves upon the built in 'unique' rule when preventing the same email address being used more than once.

Some email providers (Gmail) allow you to use + in the email address to create 'aliases'. For example if your email address is somename@gmail.com you can also use:

and they all work. The normal 'unique' rule would allow these as they are all different. This rule sees these all as the same and will disallow using the same 'somename@gmail.com' account.

Some email providers (Gmail) also allow you to place periods anywhere before the @ sign in the email address and these will all work. For example if your email address is somename@gmail.com you can also use:

Requirements

Your MySQL server must support the non-greedy regex operator. This has been tested with MySQL 8 and MariaDB 10.2 so those versions or newer should work.

Installation

composer require antriver/laravel-unique-email-validator

Usage

    $this->validate(
        $request,
        [
            // Check for other use of the same email address in the users.email column.
            'email' => [new \Antriver\LaravelUniqueEmailValidator\UniqueEmailRule('users', 'email')],
        ]
    );

Like the original unique rule you can specify certain rows should be excluded. This is useful when updating a user and that should not reject the user's existing registered email address:

    $this->validate(
        $request,
        [
            'email' => [new \Antriver\LaravelUniqueEmailValidator\UniqueEmailRule('users', 'email', ['id' => 123])],
            // Where 123 is the 'id' of the existing user.
        ]
    );

统计信息

  • 总下载量: 10
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-12-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固