https://github.com/kawax/laravel-line-sdk
https://github.com/kawax/laravel-line-sdk
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/kawax/laravel-line-sdk
- Owner: kawax
- License: mit
- Created: 2020-10-14T07:05:51.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2025-03-27T08:12:23.000Z (4 months ago)
- Last Synced: 2025-04-09T18:18:00.941Z (3 months ago)
- Language: PHP
- Homepage: https://packagist.org/packages/revolution/laravel-line-sdk
- Size: 205 KB
- Stars: 19
- Watchers: 4
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# LINE SDK for Laravel
[](https://packagist.org/packages/revolution/laravel-line-sdk)

[](https://codeclimate.com/github/kawax/laravel-line-sdk/maintainability)
[](https://codeclimate.com/github/kawax/laravel-line-sdk/test_coverage)## 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.2
- Laravel >= 11.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
```shell
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)` and `Channel secret`. Set `Webhook URL`
- LINE Login : Get `Channel ID` and `Channel secret`. Set `Callback 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" | bashcd ./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
- [Messaging API / Bot](./docs/bot.md)
- [Socialite](./docs/socialite.md)
- [Notifications](./docs/notification.md)## Demo
https://github.com/kawax/laravel-line-project## LICENSE
MIT