divineomega / sms-providers
Provides data on popular SMS providers
Fund package maintenance!
DivineOmega
Requires
- php: >=7.1
- divineomega/php-countries: ^2.1.3
This package is auto-updated.
Last update: 2024-10-08 09:57:43 UTC
README
This library provides data on popular SMS providers.
Installation
To install the SMS Providers package, simply run the following Composer command from the root of your project.
composer require divineomega/sms-providers
Usage
Get providers by destination country
You can retrieve all the providers that deliver SMS to specific countries. See the following code for an example.
$country = (new Countries())->getByName('United Kingdom'); $providers = (new Providers())->getByDestinationCountry($country);
This code will retrieve an array of all the providers that support sending text messages to phone numbers starting with the '44' calling code (United Kingdom).
Get providers by calling code
You can retrieve all the providers that deliver SMS to numbers beginning with a specific calling code. See the following example snippet.
$providers = (new Providers())->getByDestinationCallingCode('44');
This code will retrieve an array of all the providers that support sending text messages to phone numbers starting with the '44' calling code (United Kingdom).