tagmood/laravel-disposable-phone is a Laravel package for disposable phone validator.
It currently has 0 GitHub stars and 422 downloads on Packagist (latest version 3.0.58).
Install it with composer require tagmood/laravel-disposable-phone.
Discover more Laravel packages by tagmood
or browse all Laravel packages to compare alternatives.
Last updated
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.
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 $providers array:
'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();
}
Use the indisposablephone validator to ensure a given field doesn't hold a disposable phone number.
'field' => 'indisposablephone',
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.