PHP code example of moririnson / laravel-line-notify

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

    

moririnson / laravel-line-notify example snippets


/**
* @return string token
*/
public function routeNotificationForLINE()
{
    return 'ACCESS_TOKEN_HERE';
}


use Illuminate\Notifications\Notification;
use Moririnson\LINENotify\Channels\LINENotifyChannel;
use Moririnson\LINENotify\Messages\LINENotifyMessage;

class LineNotify extends Notification
{
    private $message;

    public function __construct($message)
    {
    	$this->message = $message;    
    }

    public function via($notifiable)
    {
        return [LINENotifyChannel::class]
    }

    public function toLINE($notifiable)
    {
        return (new LINENotifyMessage())->message($this->message);
    }
}