PHP code example of simonkub / laravel-sipgate-notifications

1. Go to this page and download the library: Download simonkub/laravel-sipgate-notifications 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/ */

    

simonkub / laravel-sipgate-notifications example snippets


return [
   
    ...

    'sipgate' => [
        'username' => env('SIPGATE_USERNAME'),
        'password' => env('SIPGATE_PASSWORD'),
        'smsId' => env('SIPGATE_SMSID'),
        'enabled' => env('SIPGATE_NOTIFICATOINS_ENABLED', true),
    ]
];

class ExampleNotification extends Notification
{
    public function via($notifiable)
    {
        return ['sipgate'];
    }

    public function toSipgate($notifiable)
    {
        return SipgateMessage::create('Your message goes here…');
    }
}

public function toSipgate($notifiable)
{
    return SipgateMessage::create('Your message goes here…')->recipient('00491234567890');
}

class User extends Authenticatable
{
    use Notifiable;

    public function routeNotificationForSipgate($notification)
    {
        return $this->phone_number;
    }
}

Notification::route('sipgate', '00491234567890')
            ->notify(new ExampleNotification($message));

public function toSipgate($notifiable)
{
    return (new SipgateMessage('Your message goes here…'))
        ->message('…or here')
        ->recipient('00491234567890')
        ->sendAt(time() + 60)
        ->smsId('s0');
}

> $message->sendAt(time() + 60);
>