PHP code example of zanozik / semysms

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

    

zanozik / semysms example snippets


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

// config/services.php
...
'semysms' => [
    'token' => env('SEMYSMS_TOKEN', '12345678901234567890'),
    'device' => env('SEMYSMS_DEVICE', '12345')
],
...
 php
use NotificationChannels\SemySMS\SemySMSChannel;
use NotificationChannels\SemySMS\SemySMSMessage;
use Illuminate\Notifications\Notification;

class InvoicePaid extends Notification{

    public function via($notifiable){
        return [SemySMSChannel::class];
    }

    public function toSmsGatewayMe($notifiable){
        return (new SemySMSMessage)->text('Your invoice has been paid');
    }
}
 php
...
/**
 * Route notifications for the SemySMS channel.
 *
 * @return int
 */
public function routeNotificationForSemySMS(){
    return $this->phone_number;
}
...