1. Go to this page and download the library: Download elimuswift/sms 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/ */
//Will send through default provider set in the config file.
SMS::send('Your SMS Message', [], function($sms) {
$sms->to('+15555555555');
});
SMS::driver('nexmo');
//Will send through Nexmo
SMS::send('Your SMS Message', [], function($sms) {
$sms->to('+15555555555');
});
/**
* Get the notification identifier for SMS.
*
* @return string
*/
public function routeNotificationForSMS()
{
return $this->attributes['phone_number'];
}
use Elimuswift\SMS\Chennels\SMSChannel;
use Elimuswift\SMS\Notifications\SMSMessage;
use Illuminate\Notifications\Notification;
class AccountApproved extends Notification
{
public function via($notifiable)
{
return [SMSChannel::class];
}
public function toSms($notifiable)
{
return (new SMSMessage())
->content("Your {$notifiable->service} account was approved!");
}
}
public function toSms($notifiable)
{
return (new SMSMessage('path.to.view'))
->viewData(['foo' => 'Bar', 'baaz' => 'blah']);
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.