PHP code example of cca-bheath / laravel-sms-clicksend
1. Go to this page and download the library: Download cca-bheath/laravel-sms-clicksend library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
cca-bheath / laravel-sms-clicksend example snippets
namespace App\Notifications;
use Illuminate\Notifications\Notification;
use NotificationChannels\ClickSend\ClickSendMessage;
use NotificationChannels\ClickSend\ClickSendChannel;
class ClickSendTest extends Notification
{
public $token;
/**
* Create a notification instance.
*
* @param string $token
*/
public function __construct($token)
{
$this->token = $token;
}
/**
* Required
*/
public function via($notifiable)
{
return [ClickSendChannel::class];
}
/**
* Required
*/
public function getMessage($notifiable)
{
return "SMS test to user #{$notifiable->id} with token {$this->token} by ClickSend";
}
/**
* Optional
*/
public function updateClickSendMessage($message)
{
$message->setFrom('+15555555555');
return $message;
}
}
...
public function routeNotificationForClickSend()
{
return $this->phone;
}
...
$client = app(ClickSendApi::class)->getClient();
// then get for eaxample yor ClickSend account details:
$account = $client->getAccount()->getAccount();
// or list of countries:
$countries = $client->getCountries()->getCountries();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.