PHP code example of ramanandapanda / jsksms

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

    

ramanandapanda / jsksms example snippets


// config/services.php
...
'jsksms' => [
    'endpoint' => env('jsksms_ENDPOINT', 'https://jsksms.com/api/v2/send'),
    'token' => env('jsksms_TOKEN', 'YOUR jsksms TOKEN HERE'),
    'sender' => env('jsksms_SENDER', 'YOUR jsksms SENDER HERE')
],
...

use Illuminate\Notifications\Notification;
use NotificationChannels\jsksms\JsksmsMessage;

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

    public function tojsksms($notifiable)
    {
        return (new JsksmsMessage)->content("Your account was approved!");       
    }
}

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

Notification::route('jsksms', '5555555555')                      
            ->notify(new InvoicePaid($invoice));