diegomagikal/laravel-tempmail

用于阻止临时邮件服务发送的验证器

v1.0.2 2018-11-11 19:02 UTC

This package is auto-updated.

Last update: 2024-09-29 05:08:34 UTC


README

阻止临时邮件使用的验证器。

简介

此包会验证输入的电子邮件是否使用了来自任何临时邮件服务的域名,并拒绝它。

安装

要获取此包的最新版本,请将以下行添加到您的 composer.json 文件中:

"diegomagikal/laravel-tempmail": "*"

用法

在电子邮件验证中使用 tempmail 规则,如下所示

/**
 * Get a validator.
 *
 * @param  array  $data
 * @return \Illuminate\Contracts\Validation\Validator
 */
protected function validator(array $data)
{
    return Validator::make($data, [
        'name' => 'required|string|max:255',
        'email' => 'required|email|max:255|unique:users|tempmail',
        'password' => 'required|min:6|checkpassword|confirmed',
    ]);
}

tempmail

自定义消息/翻译

将 'tempmail' 键添加到 resources/lang/{YOUR_LANG}/validation.php 中,并输入您想要的消息。

 	/*
    |--------------------------------------------------------------------------
    | Custom Validation Language Lines
    |--------------------------------------------------------------------------
    |
    | Here you may specify custom validation messages for attributes using the
    | convention "attribute.rule" to name the lines. This makes it quick to
    | specify a specific custom language line for a given attribute rule.
    |
    */


    'tempmail' => 'Este tipo de e-email não é aceito. Digite seu email real!',

tempmail-pt

阻止的服务(持续增加)

以下提供者的所有域名都被阻止:

  • temp-mail.org
  • tempm.com
  • getinboxes.com
  • getnada.com

许可证

MIT 许可证(MIT)。有关更多信息,请参阅许可证文件