PHP code example of nexmo / laravel-notification

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

    

nexmo / laravel-notification example snippets


// To a user
$user->notify(new \App\Notifications\MerryChristmas());

// To any person
Notification::route(
    'nexmo-whatsapp',
    'YOUR_NUMBER'
)->notify(new \App\Notifications\MerryChristmas());

public function toNexmoViberServiceMessage($notifiable)
{
    return (new Text)->content('Merry Christmas Viber!')->from("YOUR_ID");
}

public function via($notifiable)
{
    return $notifiable->via_whatsapp ? ['nexmo-whatsapp'] : ['mail'];
}