PHP code example of chevgenio / smspilot-notification-channel

1. Go to this page and download the library: Download chevgenio/smspilot-notification-channel 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/ */

    

chevgenio / smspilot-notification-channel example snippets


// config/services.php
...
'smspilot' => [
    'apikey' => env('SMSPILOT_APIKEY'),
    'sender' => env('SMSPILOT_SENDER', 'INFORM'),
    'callback' => env('SMSPILOT_CALLBACK_URL', ''),
    'callback_method' => env('SMSPILOT_CALLBACK_METHOD', 'get'),
],
...

use Illuminate\Notifications\Notification;
use Chevgenio\SmsPilot\SmsPilotMessage;
use Chevgenio\SmsPilot\SmsPilotChannel;

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

    public function toSmsPilot($notifiable)
    {
        return (new SmsPilotMessage)
            ->content("Order successfully completed.");
    }
}

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