PHP code example of kpherox / laravel-notification-line

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

    

kpherox / laravel-notification-line example snippets


use NotificationChannels\Line\LineChannel;
use NotificationChannels\Line\LineMessage;

class NewsWasPublished extends Notification
{

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

    public function toLine($notifiable)
    {
        return new LineMessage('Laravel notifications are awesome!'/*, 'Multiple message. Max: 5'*/);
    }
}

class LineUser extends Eloquent
{
    use Notifiable;

    public function routeNotificationForLine()
    {
        return $this->id;
    }
...