- Working with Laravel Event System. Including Webhook routing and controller.
- Extensible Bot Client.
- Working with Laravel Notification System(LINE Notify)
- Including Socialite drivers(LINE Login, LINE Notify)
- PHP >= 8.1
- Laravel >= 10.0
- Basic : semver
- Drop old PHP or Laravel version :
+0.1
. composer should handle it well. - Support only latest major version (
master
branch), but you can PR to old branches.
composer require revolution/laravel-line-sdk
composer remove revolution/laravel-line-sdk
- Delete related files. See below.
Set up in LINE Developers console. https://developers.line.biz/
Create two channels Messaging API
and LINE Login
.
- Messaging API : Get
Channel access token (long-lived)
andChannel secret
. SetWebhook URL
- LINE Login : Get
Channel ID
andChannel secret
. SetCallback URL
LINE_BOT_CHANNEL_TOKEN=
LINE_BOT_CHANNEL_SECRET=
LINE_LOGIN_CLIENT_ID=
LINE_LOGIN_CLIENT_SECRET=
LINE_LOGIN_REDIRECT=
LINE_NOTIFY_CLIENT_ID=
LINE_NOTIFY_CLIENT_SECRET=
LINE_NOTIFY_REDIRECT=
LINE_NOTIFY_PERSONAL_ACCESS_TOKEN=
php artisan vendor:publish --tag=line-config
- Create
Messaging API
channel in LINE Developers console. - Get
Channel access token (long-lived)
,Channel secret
and QR code. - A web server that can receive webhooks from LINE. Not possible on a normal local server.
# Docker
curl -s "https://laravel.build/line-bot" | bash
cd ./line-bot
composer require revolution/laravel-line-sdk
Edit .env
LINE_BOT_CHANNEL_TOKEN=
LINE_BOT_CHANNEL_SECRET=
Publishing Listeners
php artisan vendor:publish --tag=line-listeners
- Set
Webhook URL
in LINE Developers console.https://example.com/line/webhook
- Verify Webhook URL.
- Using QR code.
Bot returns same message.
https://github.com/kawax/laravel-line-project
MIT