2017 © Pedro Peláez
 

library laravel-notification-line

LINE Notifications Driver

image

kpherox/laravel-notification-line

LINE Notifications Driver

  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 37 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

LINE notification channels for Laravel 5.3+

Latest Version on Packagist Software License Build Status StyleCI SensioLabsInsight Quality Score Code Coverage Total Downloads, (*1)

This package makes it easy to send notifications using LINE with Laravel 5.3., (*2)

Contents

Installation

You can install this package via composer:, (*3)

composer require kpherox/laravel-notification-line

Setting up the LINE service

  1. Start using Messaging API
    • Select Plan: Developer Trial, Or upgrade to Pro after selecting Free.
  2. Click the Messaging settings button on your channel.
  3. Paste your channel's access token and secret, in your services.php config file:
...
'line' => [
    'token'    => env('LINE_CHANNEL_ACCESS_TOKEN'),
    'secret' => env('LINE_CHANNEL_SECRET'),
    'userd'   => env('LINE_DEFAULT_USER_ID')
]
...

Usage

Follow Laravel's documentation to add the channel to your Notification class., (*4)

Text Message

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'*/);
    }
}

Custom User

If you need to change the user, add the routeNotificationForLine method to the model:, (*5)

class LineUser extends Eloquent
{
    use Notifiable;

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

Changelog

Please see CHANGELOG for more information what has changed recently., (*6)

Testing

bash $ composer test, (*7)

Security

If you discover any security related issues, please email admin@mail.kr-kp.com instead of using the issue tracker., (*8)

Contributing

Please see CONTRIBUTING for details., (*9)

Credits

License

The MIT License (MIT). Please see License File for more information., (*10)

The Versions