Webhook
The package includes Webhook routing and a controller out of the box.Webhook URL
The default Webhook URL is:.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
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.
Replacing the WebhookHandler
If you want to handle Webhooks without the Laravel Event System, implement theWebhookHandler interface.
Create app/Actions/LineWebhook.php:
AppServiceProvider@register:
Default route middleware
Thethrottle middleware is enabled by default. Configure it via .env:
Http::line()
The package extends theHttp class, so you can make LINE API requests directly without using the Bot Facade.
For the latest updates, see the GitHub repository.