revolution / laravel-line-sdk
LINE SDK for Laravel
Installs: 27 664
Dependents: 0
Suggesters: 0
Security: 0
Stars: 19
Watchers: 5
Forks: 7
Open Issues: 1
Requires
- php: ^8.1
- ext-json: *
- illuminate/support: ^10.0||^11.0
- laravel/socialite: ^5.0
- linecorp/line-bot-sdk: ^9.0
Requires (Dev)
- orchestra/testbench: ^8.0||^9.0
- dev-master
- 3.x-dev
- 3.4.0
- 3.3.8
- 3.3.7
- 3.3.6
- 3.3.5
- 3.3.4
- 3.3.3
- 3.3.2
- 3.3.1
- 3.3.0
- 3.2.5
- 3.2.4
- 3.2.3
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.0
- 3.0.1
- 3.0.0
- 2.x-dev
- 2.2.5
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.0
- 2.0.2
- 2.0.1
- 2.0.0
- 1.x-dev
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.8
- 1.2.7
- 1.2.6
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
This package is auto-updated.
Last update: 2024-12-06 03:32:04 UTC
README
Features
- Working with Laravel Event System. Including Webhook routing and controller.
- Extensible Bot Client.
- Working with Laravel Notification System(LINE Messaging API)
- Including Socialite drivers(LINE Login)
Requirements
- PHP >= 8.1
- Laravel >= 10.0
Versioning
- 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.
Installation
composer require revolution/laravel-line-sdk
Uninstall
composer remove revolution/laravel-line-sdk
- Delete related files. See below.
Configuration
.env
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=
Publishing(Optional)
php artisan vendor:publish --tag=line-config
Quick Start
Prepare
- 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.
Create new Laravel project
# 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
Deploy to web server
- Set
Webhook URL
in LINE Developers console.https://example.com/line/webhook
- Verify Webhook URL.
Add bot as a friend.
- Using QR code.
Send test message
Bot returns same message.
Documents
Demo
https://github.com/kawax/laravel-line-project
LICENSE
MIT