PHP code example of yakimka / laravel-notification-channel-turbosms

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

    

yakimka / laravel-notification-channel-turbosms example snippets


// config/app.php
'providers' => [
    ...
    NotificationChannels\TurboSms\TurboSmsServiceProvider::class,
],

// config/services.php
...
'turbosms' => [
    'login' => env('TURBOSMS_LOGIN'),
    'secret' => env('TURBOSMS_SECRET'),
    'sender' => 'BRAND',
    'url' => 'http://turbosms.in.ua/api/wsdl.html',
],
...

use Illuminate\Notifications\Notification;
use NotificationChannels\TurboSms\TurboSmsMessage;
use NotificationChannels\TurboSms\TurboSmsChannel;

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

    public function toTurboSms($notifiable)
    {
        return TurboSmsMessage::create("Task #{$notifiable->id} is complete!");
    }
}

public function routeNotificationForTurboSms()
{
    return $this->phone;
}

Notification::route('turbosms', '+380501234567')->notify(new AccountApproved());

Notification::route('turbosms', '+380501234567,+380631234567')->notify(new AccountApproved());