PHP code example of mkohei / laravel-td-notification-channel

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

    

mkohei / laravel-td-notification-channel example snippets


use Mkohei\LaravelTdNotificationChannel\TreasureDataChannel;
use Mkohei\LaravelTdNotificationChannel\TreasureDataMessage;
use Illuminate\Notifications\Notification;

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

    public function toTreasureData($notifiable)
    {
        return TreasureDataMessage::create()
            ->data([
               'param1' => 'value',
               'param2' => 1234,
            ])
            ->apikey('YOUR_WRITE_ONLY_KEY')
            ->database('your_db')
            ->table('your_table');
    }
}

public function routeNotificationForTreasureData()
{
    return 'https://in.treasuredata.com';
}