PHP code example of astrotomic / notifynder-sender-nexmo

1. Go to this page and download the library: Download astrotomic/notifynder-sender-nexmo 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/ */

    

astrotomic / notifynder-sender-nexmo example snippets


'senders' => [
    'nexmo' => [
        'key' => '',
        'secret' => '',
        'store' => false, // wether you want to also store the notifications in database
    ],
],


namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Astrotomic\Notifynder\Senders\NexmoSender;
use Astrotomic\Notifynder\Senders\Messages\SmsMessage;
use Fenos\Notifynder\Builder\Notification;

class AppServiceProvider extends ServiceProvider
{
    public function boot()
    {
        app('notifynder.sender')->setCallback(NexmoSender::class, function (SmsMessage $message, Notification $notification) {
            return $message
                ->from('0123456789')
                ->to('9876543210')
                ->text($notification->getText());
        });
    }
}