PHP code example of anheric / laravel-routee-channel

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

    

anheric / laravel-routee-channel example snippets


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

// config/services.php
'routee' => [
    'app_id'  => env('ROUTEE_APP_ID'),
    'secret' => env('ROUTEE_SECRET'),
    'from' => env('ROUTEE_SENDER_ID'),
],

use Illuminate\Notifications\Notification;
use NotificationChannels\Routee\RouteeMessage;
use NotificationChannels\Routee\RouteeChannel;

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

    public function toRoutee($notifiable)
    {
        return (new RouteeMessage)
            ->content("Your message here");
    }
}

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