Download the PHP package nanato12/phine without Composer
On this page you can find all versions of the php package nanato12/phine. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nanato12/phine
More information about nanato12/phine
Files in nanato12/phine
Package phine
Short Description LINE Messaging API SDK for PHP Wrapper
License Apache-2.0
Homepage https://github.com/nanato12/phine
Informations about the package phine
Phine
A developer-friendly wrapper for the LINE Messaging API SDK for PHP.
Phine simplifies common LINE bot operations by providing intuitive message builders, event handlers, and convenient client methods.
Installation
Requirements
- PHP >= 8.1
- linecorp/line-bot-sdk ^12.4
Quick Start
Client
The Client class extends MessagingApiApi from the official LINE SDK, so all original methods are available.
Message Builders
Phine provides convenient builders for creating LINE messages.
TextMessageBuilder
RawFlexMessageBuilder
Build Flex Messages from a JSON array. Useful when designing messages with the Flex Message Simulator.
ImageMessageBuilder
VideoMessageBuilder
AudioMessageBuilder
StickerMessageBuilder
LocationMessageBuilder
Client Methods
parseEventRequest
Parses the incoming webhook request body and validates the signature.
setEvent
Stores the current event in the client instance. Required before calling reply().
reply
Sends a reply message to the user. Must call setEvent() first.
push
Sends a push message to a specific user, group, or room.
sendMulticast
Sends a message to multiple users at once (up to 500 users).
sendBroadcast
Sends a message to all users who have added your bot as a friend.
getProfileFromUserID
Retrieves a user's profile. Automatically uses the appropriate API based on the event source (user, group, or room).
Event Handlers
Phine provides an event handling system to organize your bot logic.
BaseEventHandler
Create handlers for specific event types:
BaseCommandHandler
Create handlers that respond to specific text commands:
For commands with arguments, use prefix matching:
EventDispatcher
Register and dispatch events to your handlers:
License
Apache-2.0