承接 erlandmuchasaj/laravel-email-verify 相关项目开发

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

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

erlandmuchasaj/laravel-email-verify

最新稳定版本:1.0.11

Composer 安装命令:

composer require erlandmuchasaj/laravel-email-verify

包简介

Validate email addresses that they are valid and non disposable.

README 文档

README

Add a simple email verification to your Laravel application. It detects if the email is disposable (temporary/throwaway/fake) email addresses. This tool also helps to avoid communication errors and blocks spam addresses.

Installation

You can install the package via composer:

composer require erlandmuchasaj/laravel-email-verify

Run the command update the list of disposable domains:

php artisan email-verify:update-disposable-domains

Config file

Publish the configuration file using artisan.

php artisan vendor:publish --provider="ErlandMuchasaj\LaravelEmailVerify\EmailVerifyServiceProvider"

Now you have access to the laravel-email-verify.php configuration file in the config directory. Here you can configure which service to use for email verification. Defaults to kickbox.

The only thing you need to pay attention to is the connections key where you need to set the token for the service you are using.

'connections' => [
        'kickbox' => [
            'domain' => 'https://open.kickbox.io/v1/disposable/',
            'email' => 'https://api.eu.kickbox.com/v2/verify',
            'key' => 'your-kickbox-api-key',
        ],
        
        //

    ],

You can also change the default service to use for email verification by changing the default key.

    /*
    |--------------------------------------------------------------------------
    | Default Email verifier
    |--------------------------------------------------------------------------
    |
    | This option controls the default verifier that is used to verify any email
    |
    | Supported: "kickbox", "usercheck", "mails", "block-temporary-email", "zerobounce"
    |            "verifyright", "mailboxvalidator", "emaillistverify"
    */

    'default' => env('INDISPOSABLE_SERVICE', 'kickbox'),

Optionally

It's highly advised to update the disposable domains list regularly. You can either run the command yourself now and then or, if you make use of Laravel scheduler, you can register the php artisan email-verify:update-disposable-domains command:

In routes/console.php:

use Illuminate\Support\Facades\Schedule;

Schedule::command('email-verify:update-disposable-domains')->weekly();

Or if you use Laravel 10 or below, head over to the Console kernel:

 protected function schedule(Schedule $schedule)
 {
     $schedule->command('email-verify:update-disposable-domains')->monthly();
 }

Usage

Use validation rule email_verify to check that specific field does not contain a disposable email address.

Note

❗ Place it after the email validator to ensure that only valid emails are processed.

Example:

// Using validation rule name:
'email_field' => 'required|email|email_verify',

@todo:

Add more services for email verification:

Support me

I invest a lot of time and resources into creating best in class open source packages.

If you found this package helpful you can show support by clicking on the following button below and donating some amount to help me work on these projects frequently.

buy me a coffee

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please see SECURITY for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-09-02