PHP code example of powertic / utalk-notification-channel

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

    

powertic / utalk-notification-channel example snippets


...

'utalk' => [
    'token' => env('UTALK_TOKEN'),
],

use Powertic\Utalk\UtalkChannel;
use Powertic\Utalk\UtalkMessage;
use Illuminate\Notifications\Notification;

class TeamCreated extends Notification
{

    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return [UtalkChannel::class];
    }

    /**
     * Get the UTalk representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return \Powertic\Utalk\UtalkMessage
     */
    public function toUtalk($notifiable)
    {
        return UtalkMessage::create()
            ->message("Hello World!");
    }
}

/**
 * Route notifications for the Utalk channel.
 *
 * @return string
*/
public function routeNotificationForUtalk()
{
    return $this->mobile;
}