PHP code example of laravel-notification-channels / touch-sms

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

    

laravel-notification-channels / touch-sms example snippets


'touchsms' => [
    'token_id' => env('TOUCHSMS_TOKEN_ID'),
    'access_token' => env('TOUCHSMS_ACCESS_TOKEN'),
    'default_sender' => env('TOUCHSMS_DEFAULT_SENDER', null),
]

use Illuminate\Notifications\Notification;
use \NotificationChannels\TouchSms\TouchSmsMessage;
use \NotificationChannels\TouchSms\TouchSmsChannel;

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

    public function toTouchsms($notifiable)
    {
        return (new TouchSmsMessage)
            ->content("Task #{$notifiable->id} is complete!");
    }
}

public function routeNotificationForTouchsms()
{
    return $this->phone; // 6142345678
}