donwel-systems/clickatell

A package to send sms via Clickatell Sms Gateway

1.0.0 2021-09-18 09:32 UTC

This package is auto-updated.

Last update: 2025-06-18 17:37:07 UTC


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

  1. Run composer require donwel-systems/clickatell
  2. Run php artisan vendor:publish
  3. Choose the DonwelSystems\Clickatell\ClickatellServiceProvider and hit enter.
  4. Edit the config/clickatell.php file accordingly
  5. 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,
  1. 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.