donwel-systems / clickatell
A package to send sms via Clickatell Sms Gateway
1.0.0
2021-09-18 09:32 UTC
Requires
- php: ^7.2.5 || ^8.0
- guzzlehttp/guzzle: ^6.3
- illuminate/support: ^5.2
README
PhP Package for sennding sms via Clickatell on both the old Communicator Central (http://api.clickatell.com) and the new Clickatell Platorm (https://platform.clickatell.com) using the https(s) protocol The Rest API for the new Clickatell Platform is not supported in this Package #Usage
- Run composer require donwel-systems/clickatell
- Run php artisan vendor:publish
- Choose the DonwelSystems\Clickatell\ClickatellServiceProvider and hit enter.
- Edit the config/clickatell.php file accordingly
- Edit config/app.php and add the ClickatellServiceProvider and 'ClickatellFacade' classes to the providers and aliases arrays
'providers' => [ ..... DonwelSystems\Clickatell\ClickatellServiceProvider::class ] 'aliases' => [ ... 'Clickatell' => DonwelSystems\Clickatell\Facades\ClickatellFacade::class,
- In your code, to send an Sms use
Clickatell::send($to,$message)
The Clickatell::send method returns an associative array i) If the message is successfully sent, the array
["result"=>'success', "code"=>'$code'];
is returned; where $code contains the unqiue message ID from clickatell
ii) If the message is no successfully sent, or an error occurs, the array
["result"=>'error', "code"=>'$code'];
is returned; where $code contains the error message.