Skip to main content

Documentation Index

Fetch the complete documentation index at: https://kawax.biz/llms.txt

Use this file to discover all available pages before exploring further.

Overview

revolution/laravel-line-sdk makes the official LINE SDK easy to use in Laravel applications. It provides four features: Webhook handling, Bot Facade, Laravel Notifications integration, and LINE Login via Socialite.
This package requires PHP 8.3 or higher and Laravel 12.0 or higher.

Installation

composer require revolution/laravel-line-sdk

Configuration

LINE Developers console

Create channels in the LINE Developers console.
You can no longer create a Messaging API channel directly from the LINE Developers Console. First create a LINE Official Account using the LINE Official Account Manager, then enable Messaging API from the account manager.
Create two channels:
ChannelWhat to get
Messaging APIChannel access token (long-lived), Channel secret
LINE LoginChannel ID, Channel secret

.env

LINE_BOT_CHANNEL_TOKEN=
LINE_BOT_CHANNEL_SECRET=

LINE_LOGIN_CLIENT_ID=
LINE_LOGIN_CLIENT_SECRET=
LINE_LOGIN_REDIRECT=

Publish config (optional)

php artisan vendor:publish --tag=line-config

Quick start

The fastest path to a working bot.
1

Create a new Laravel project

laravel new line-bot
cd ./line-bot
composer require revolution/laravel-line-sdk
2

Configure .env

LINE_BOT_CHANNEL_TOKEN=
LINE_BOT_CHANNEL_SECRET=
3

Publish the default Listener

php artisan vendor:publish --tag=line-listeners
This generates MessageListener in app/Listeners/Line/.
4

Deploy to a web server

LINE requires a publicly accessible URL to deliver webhooks. Local servers are not supported.Set the Webhook URL in the LINE Developers console:
https://example.com/line/webhook
5

Add the bot as a friend and test it

Use the QR code from the Messaging API channel to add the bot. Send a message and MessageListener will echo it back.

Documentation

Webhook / Bot

Webhook routing and Bot Facade for sending and receiving messages.

Notifications

Send LINE messages through the Laravel Notification System.

Socialite (LINE Login)

OAuth2 authentication with LINE Login via Socialite.
Last modified on May 3, 2026