PHP code example of laravel-notification-channels / vodafone

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

    

laravel-notification-channels / vodafone example snippets


use NotificationChannels\Vodafone\VodafoneClient;

$vc = new VodafoneClient();
$vc->receive();

// A static method is also available
VodafoneClient::getUnread();

use NotificationChannels\Vodafone\VodafoneClient;

$ex = false;
do {
    try {
        $message = VodafoneClient::getUnread();
        // Process Message
    } catch (\Exception $ex) {}
} while (!$ex);
 php
$user->notify(new Notification())
 php
'vodafone' => [
    'username' => env('VODAFONE_USERNAME'),
    'password' => env('VODAFONE_PASSWORD'),
]
 php
use Illuminate\Notifications\Notification;
use NotificationChannels\Vodafone\VodafoneChannel;
use NotificationChannels\Vodafone\VodafoneMessage;

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

    public function toVodafone($notifiable)
    {
        return (new VodafoneMessage)
            ->content($this->content)
            ->from('My App');
    }
 php
public function routeNotificationForVodafone()
{
    return $this->phone;
}