PHP code example of onix-solutions / sms-telera

1. Go to this page and download the library: Download onix-solutions/sms-telera 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/ */

    

onix-solutions / sms-telera example snippets


// config/app.php
'providers' => [
    ...
    OnixSolutions\SmsTelera\SmsTeleraServiceProvider::class,
],

// config/services.php
...
'smsctelera' => [
    'tk'  => env('SMSCTELERA_TK'),
    'sender' => env('SMSCTELERA_SENDER')
],
...

// config/services.php
...
'smsctelera' => [
    ...
    'host' => env('SMSCTELERA_HOST'),
    ...
],
...

use Illuminate\Notifications\Notification;
use OnixSolutions\SmsTelera\SmsTeleraMessage;
use OnixSolutions\SmsTelera\SmsTeleraChannel;

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

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

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