PHP code example of diviky / laravel-messenger-people

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

    

diviky / laravel-messenger-people example snippets


// config/services.php
...
'messengerpeople' => [
    'client_id' => env('MP_CLIENT_ID'),
    'client_secret' => env('MP_CLIENT_SECRET'),
    'number_id' => env('MP_NUMBER_ID'),
],
...

use NotificationChannels\MessengerPeople\Channel;
use NotificationChannels\MessengerPeople\Message;
use Illuminate\Notifications\Notification;

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

    public function toMessengerPeople($notifiable)
    {
        return (new Message())
            ->text("Your {$notifiable->service} account was approved!");
    }
}

public function routeNotificationForMobtexting()
{
    return '+1234567890';
}