PHPackages                             hoangkhacphuc/zalo\_bot - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. hoangkhacphuc/zalo\_bot

ActiveLibrary[API Development](/categories/api)

hoangkhacphuc/zalo\_bot
=======================

A PHP library for building Zalo chatbots. This library works in plain PHP, Laravel, or any PHP framework. It provides a set of Data Transfer Objects (DTOs), exceptions, and helper methods to interact with the Zalo API and handle messages safely.

v1.0.0(9mo ago)01MITPHPPHP ^8.1CI passing

Since Sep 9Pushed 9mo agoCompare

[ Source](https://github.com/hoangkhacphuc/zalo_bot)[ Packagist](https://packagist.org/packages/hoangkhacphuc/zalo_bot)[ RSS](/packages/hoangkhacphuc-zalo-bot/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (6)Versions (2)Used By (0)

Hoangkhacphuc/ZaloBot
=====================

[](#hoangkhacphuczalobot)

A lightweight, framework-agnostic PHP SDK to build Zalo chatbots with safety, testability, and developer ergonomics.

Features
--------

[](#features)

- Handle Zalo messages and events
- Type-safe DTOs: `Message`, `Webhook`, `InfoMe`, `MessageResponse`
- SOLID architecture with interfaces and DI
- Works in plain PHP or Laravel
- Rich exceptions for robust error handling

Why Use This Library?
---------------------

[](#why-use-this-library)

- Framework-independent: works anywhere
- Type-safe: DTOs ensure validated data
- Testable: dependency-injected collaborators and factories
- Extensible: swap implementations via interfaces
- Production-ready: explicit errors and safe parsing

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- Composer
- Optional: Laravel 9+ for Laravel integration

Installation
------------

[](#installation)

Install via Composer:

```
composer require hoangkhacphuc/zalo_bot
```

Quick Start (Plain PHP)
-----------------------

[](#quick-start-plain-php)

```
