PHP code example of fomvasss / laravel-notification-channel-sendberry

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

    

fomvasss / laravel-notification-channel-sendberry example snippets


// config/app.php
'providers' => [
    ...
    NotificationChannels\Sendberry\SendberryServiceProvider::class,
],

// config/services.php
...
'sendberry' => [
    'username'  => env('SENDBERRY_USERNAME'),
    'password'  => env('SENDBERRY_PASSWORD'),
    'auth_key'  => env('SENDBERRY_AUTH_KEY'),
    'from'  => env('SENDBERRY_FROM'),
    'webhook'  => env('SENDBERRY_WEBHOOK'),
    'test_mode'  => env('SENDBERRY_TEST_MODE', false),
],
...

use Illuminate\Notifications\Notification;
use NotificationChannels\Sendberry\SendberryMessage;
use NotificationChannels\Sendberry\SendberryChannel;

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

    public function toSendberry($notifiable)
    {
        return (new SendberryMessage())->content("Hello SMS!!!")->test(true);
    }
}

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