Skip to main content

Webhook

The package includes Webhook routing and a controller out of the box.

Webhook URL

The default Webhook URL is:
You can change the path via .env:

Working with the Laravel Event System

When a Webhook event is received, a Laravel event is dispatched. Event discovery is enabled by default.
In production, run php artisan event:cache.

Publish the default Listener

This generates MessageListener in app/Listeners/Line/.

Bot Facade

Revolution\Line\Facades\Bot delegates to all methods of the official SDK MessagingApiApi class.

reply method

Bot::reply() sends a reply using a reply token.
Push delivery (Bot::pushMessage()) is subject to monthly message limits depending on your pricing plan. Replies to user messages (Bot::reply()) have no message limit and are free.

Customization

Bot macro

Bot is Macroable, so you can add any method you need. Register macros in AppServiceProvider@boot:

Replacing the MessagingApiApi instance

Bot::bot() returns the MessagingApiApi instance. Use Bot::botUsing() to swap it out.
A callable is also accepted:

Replacing the WebhookHandler

If you want to handle Webhooks without the Laravel Event System, implement the WebhookHandler interface. Create app/Actions/LineWebhook.php:
Register it in AppServiceProvider@register:

Default route middleware

The throttle middleware is enabled by default. Configure it via .env:

Http::line()

The package extends the Http class, so you can make LINE API requests directly without using the Bot Facade.
For the latest updates, see the GitHub repository.
Last modified on May 3, 2026