PHP code example of toshiyoung / laravel-smsru-channel

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

    

toshiyoung / laravel-smsru-channel example snippets


use Illuminate\Notifications\Notification;
use TY\SmsRu\Messages\SmscRuMessage;
use TY\SmsRu\Channels\SmscRuChannel;

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

    public function toSmsRu($notifiable)
    {
        return new SmsRuMessage("Привет! Это тестовое СМС.");
    }
}

Notification::route('sms_ru', '79001231234')->notify(new SmsNotify());

php artisan vendor:publish --provider="TY\SmsRu\SmsRuServiceProvider"