PHP code example of pugofka / laravel-smsru-notification-channel

1. Go to this page and download the library: Download pugofka/laravel-smsru-notification-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/ */

    

pugofka / laravel-smsru-notification-channel example snippets


...
'providers' => [
    ...
     NotificationChannels\SmsRu\SmsRuServiceProvider::class,
],
...

// config/services.php
...
'smsru' => [
    'api_id' => env('SMSRU_API_ID'),
    'sender' => 'John_Doe'
],
...
 php
use NotificationChannels\SmsRu\SmsRuChannel;
use NotificationChannels\SmsRu\SmsRuMessage;
use Illuminate\Notifications\Notification;

class ExampleNotification extends Notification
{
    public function via($notifiable)
    {
        return [SmsRuChannel::class];
    }

    public function toSmsRu($notifiable)
    {
        return SmsRuMessage::create('message text');
    }
}