kpherox / laravel-notification-line
This package is abandoned and no longer maintained.
No replacement package was suggested.
LINE Notifications Driver
1.0.0
2018-08-12 13:15 UTC
Requires
- php: >=5.6.4
- illuminate/notifications: ^5.3|^5.4|^5.5|^5.6
- illuminate/support: ^5.1|^5.2|^5.3|^5.4|^5.5|^5.6
- linecorp/line-bot-sdk: ^2.3
Requires (Dev)
- mockery/mockery: ^0.9.5
- phpunit/phpunit: 4.*
This package is auto-updated.
Last update: 2023-04-03 23:25:33 UTC
README
This package makes it easy to send notifications using LINE with Laravel 5.3.
Contents
Installation
You can install this package via composer:
composer require kpherox/laravel-notification-line
Setting up the LINE service
- Start using Messaging API
- Select Plan:
Developer Trial
, Or upgrade toPro
after selectingFree
.
- Select Plan:
- Click the
Messaging settings
button on your channel. - 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.
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:
class LineUser extends Eloquent
{
use Notifiable;
public function routeNotificationForLine()
{
return $this->id;
}
...
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
$ composer test
Security
If you discover any security related issues, please email admin@mail.kr-kp.com instead of using the issue tracker.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.