PHP code example of lookberry / laravel-smsglobal-notifications-channel

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

    

lookberry / laravel-smsglobal-notifications-channel example snippets


use Illuminate\Notifications\Notification;
use SalamWaddah\SmsGlobal\SmsGlobalChannel;
use SalamWaddah\SmsGlobal\SmsGlobalMessage;

class OrderPaid extends Notification
{

    public function via($notifiable): array
    {
        return [
            SmsGlobalChannel::class,
        ];
    }

    public function toSmsGlobal(): SmsGlobalMessage
    {
        $message = 'Order paid, Thank you for your business!';

        $smsGlobal = new SmsGlobalMessage();

        return $smsGlobal->content($message);
    }
}

Notification::send(
    '+971555555555',
    new OrderPaid($order)
);

public function toSmsGlobal(): SmsGlobalMessage
{
    $message = 'Order paid, Thank you for your business!';

    $smsGlobal = new SmsGlobalMessage();

    return $smsGlobal->content($message);
}