PHP code example of rf1705 / messagebird

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

    

rf1705 / messagebird example snippets


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

// config/services.php
...
'messagebird' => [
    'access_key' => env('MESSAGEBIRD_ACCESS_KEY'),
    'originator' => env('MESSAGEBIRD_ORIGINATOR'),
    'recipients' => env('MESSAGEBIRD_RECIPIENTS'),
],
...

// .env
...
MESSAGEBIRD_ACCESS_KEY=
MESSAGEBIRD_ORIGINATOR=
MESSAGEBIRD_RECIPIENTS=
],
...
 php
use NotificationChannels\Messagebird\MessagebirdChannel;
use NotificationChannels\Messagebird\MessagebirdMessage;
use Illuminate\Notifications\Notification;

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

    public function toMessagebird($notifiable)
    {
        return (new MessagebirdMessage("Your {$notifiable->service} was ordered!"));
    }
}
 php
return (new MessagebirdMessage("Your {$notifiable->service} was ordered!"))->setRecipients($recipients);
 php
return (new MessagebirdMessage("Your {$notifiable->service} was ordered!"))->setReference($id);