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
-
Run the Composer require command to install the package:
composer require tagmood/laravel-disposable-phone
-
If you don't use auto-discovery, open up your app config and add the Service Provider to the
$providersarray:'providers' => [ ... Tagmood\LaravelDisposablePhone\DisposablePhoneServiceProvider::class, ],
-
Publish the configuration file and adapt the configuration as desired:
php artisan vendor:publish --tag=laravel-disposable-phone
-
Run the following artisan command to fetch an up-to-date list of disposable numbers:
php artisan disposablephone:update
-
(optional) In your languages directory, add for each language an extra language line for the validator:
'indisposablephone' => 'Disposable phone numbers are not allowed.',
-
(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
其他信息
- 授权协议: MIT
- 更新时间: 2021-08-28