PHP code example of webregul / laravel-sms-ru-channel
1. Go to this page and download the library: Download webregul/laravel-sms-ru-channel 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/ */
webregul / laravel-sms-ru-channel example snippets
use Illuminate\Notifications\Notification;
use Kafkiansky\SmsRu\Message\SmsRuMessage;
use Kafkiansky\SmsRu\Message\To;
use Kafkiansky\SmsRuChannel\SmsRuChannel;
final class RegistrationComplete extends Notification
{
public function via($notifiable)
{
return [SmsRuChannel::class];
}
public function toSmsRu($notifiable)
{
return new SmsRuMessage(new To($notifiable->phone, 'Congratulations, you have become part of our application'));
}
}
use Illuminate\Notifications\Notifiable;
/**
* @property string $phone
*/
class User
{
use Notifiable;
public function routeNotificationForSmsRu()
{
return $this->phone; // can be array of phone numbers
}
}
use Illuminate\Notifications\Notification;
use Kafkiansky\SmsRuChannel\SmsRuChannel;
final class RegistrationComplete extends Notification
{
public function via($notifiable)
{
return [SmsRuChannel::class];
}
public function toSmsRu($notifiable)
{
return 'Congratulations, you have become part of our application';
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.