定制 tagmood/laravel-disposable-phone 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

tagmood/laravel-disposable-phone

最新稳定版本:3.0.53

Composer 安装命令:

composer require tagmood/laravel-disposable-phone

包简介

Disposable phone validator

README 文档

README

Adds a validator to Laravel for checking whether a given phone number isn't originating from disposable phone services. Uses the disposable numbers blacklist from iP1SMS/disposable-phone-numbers by default.

Installation

  1. Run the Composer require command to install the package:

    composer require tagmood/laravel-disposable-phone
  2. If you don't use auto-discovery, open up your app config and add the Service Provider to the $providers array:

    'providers' => [
       ...
    
       Tagmood\LaravelDisposablePhone\DisposablePhoneServiceProvider::class,
    ],
  3. Publish the configuration file and adapt the configuration as desired:

    php artisan vendor:publish --tag=laravel-disposable-phone
  4. Run the following artisan command to fetch an up-to-date list of disposable numbers:

    php artisan disposablephone:update
  5. (optional) In your languages directory, add for each language an extra language line for the validator:

    'indisposablephone' => 'Disposable phone numbers are not allowed.',
  6. (optional) It's highly advised to update the disposable numbers list regularly. You can either run the command yourself now and then or, if you make use of Laravel's scheduler, include it over there (App\Console\Kernel):

    protected function schedule(Schedule $schedule)
    {
        $schedule->command('disposablephone:update')->weekly();
    }

Usage

Use the indisposablephone validator to ensure a given field doesn't hold a disposable phone number.

'field' => 'indisposablephone',

Custom fetches

By default the package retrieves a new list by using file_get_contents(). If your application has different needs (e.g. when behind a proxy) please review the disposable-phone.fetcher configuration value.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-08-28