PHP code example of fomvasss / laravel-notification-channel-turbo-sms

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

    

fomvasss / laravel-notification-channel-turbo-sms example snippets


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

// config/services.php
...
'turbosms' => [
    'api_token'  => env('TURBOSMS_API_TOKEN'),
    'sender'  => env('TURBOSMS_SENDER'),        // for test sending use TAXI 
    'is_test'  => env('TURBOSMS_IS_TEST'),
    
    // optional
    'timeout'  => env('TURBOSMS_TIMEOUT'),
    'connect_timeout'  => env('TURBOSMS_CONNECT_TIMEOUT'),
],
...

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 (new TurboSmsMessage())->content("Hello SMS!!!")->test(true);
    }
}

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