PHPackages                             lyfing/laravel-chatbot - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. lyfing/laravel-chatbot

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

lyfing/laravel-chatbot
======================

chatbot for laravel

v1.0.2(8y ago)146MITPHP

Since May 16Pushed 8y agoCompare

[ Source](https://github.com/osdebianly/laravel-chatbot)[ Packagist](https://packagist.org/packages/lyfing/laravel-chatbot)[ RSS](/packages/lyfing-laravel-chatbot/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (4)Used By (0)

基于AIML的PHP聊天天机器人 from [ChatBot](https://github.com/kompasim/chatbot)
====================================================================

[](#基于aiml的php聊天天机器人--from-chatbot)

0. 安装
-----

[](#0-安装)

`composer require 'lyfing\laravel-chatbot'`

1. 配置
-----

[](#1-配置)

添加 `Lyfing\LaravelChatBot\ChatBotServiceProvider::class,` 到 config/app.php `providers`

2. 发布
-----

[](#2-发布)

> ` php artisan vendor:publish`

4. 配置 config
------------

[](#4-配置-config)

> 你可以直接编辑 `config/chatbot.php` 文件

5. 配置 aiml
----------

[](#5-配置-aiml)

> 编辑 `storage/chatbot/aiml` 目录下文件

> - `chatbot.aiml` 是入口文件 ，它里面的 `aiml` 标签可以包含多个 `category` 标签 , 一个 `default`标签和多个 `include`标签。

> - 被你添加的其它 `aiml` 文件在根`aiml`标签里必须要包含一个 `topic` 标签 , 这个topic标签可以包含多个 `category` 标签和一个`default`标签 (这里的其他aiml文件不能写`include`标签，`include`标签只能出现在`chatbot.aiml`文件里)。

6. 测试聊天机器人
----------

[](#6-测试聊天机器人)

> 你可以打开 `http://127.0.0.1:/chatbot`进行和机器人聊天做测试。

7. 调用聊天机器人
----------

[](#7-调用聊天机器人)

> 如果希望在自己的应用里面调用聊天机器人我们可以这样调用它的api `api?requestType=talk&userInput=hello`

8. 关于匹配规则
---------

[](#8-关于匹配规则)

> 修改之后的匹配规则 :

```
* ---> (\S+)
# ---> \S+
_ ---> .*
= ---> \S*
```

9. 关于AIML标签
-----------

[](#9-关于aiml标签)

> 本聊天机器人的`aiml`标签和标准`aiml`标签有所不同，我根据需求对标签做了一些个性化，我们可以在[AIML.MD](AIML.md)文件里面查到更多本聊天机器人所支持的标签。

14. 关于数据库
---------

[](#14-关于数据库)

> `log` 存储日志的表 .

> `property` 是存储`user`和`bot`的有关属性的表 , 相当于我们聊天机器人的脑袋，帮我们记住一些属性。 set ,get, del, user, bot 等标签是用来操作这个表的 .

> `data` 表用来存储用户的输入，机器人的回复，`input `, `that`, `topic` 等标签会操作`Parser::$_data`数组，每次程序开始运行的时候程序会从这个表加载数据到这个数组里，然后程序要结束的时候再会存储到这个表里面。表的唯一标示还是`userId`。

---

Enjoy it
========

[](#enjoy-it)

> [详情查看](https://github.com/kompasim/chatbot)

[![chatbot](./resources/assets/img/demo.png)](./resources/assets/img/demo.png)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

3281d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/eed44803a3078940e77103eefdc45a5d0f1debfe011a80ec2951f82c2677c1dd?d=identicon)[osdebianly](/maintainers/osdebianly)

---

Top Contributors

[![osdebianly](https://avatars.githubusercontent.com/u/10162474?v=4)](https://github.com/osdebianly "osdebianly (4 commits)")

### Embed Badge

![Health badge](/badges/lyfing-laravel-chatbot/health.svg)

```
[![Health](https://phpackages.com/badges/lyfing-laravel-chatbot/health.svg)](https://phpackages.com/packages/lyfing-laravel-chatbot)
```

###  Alternatives

[ishanvyas22/asset-mix

Asset Mix plugin for CakePHP

3375.4k2](/packages/ishanvyas22-asset-mix)[prgayman/laravel-zatca

Laravel package a helper to Generate the QR code and signed it for ZATCA E-invoicing

2926.9k1](/packages/prgayman-laravel-zatca)[ducks-project/spl-types

Polyfill Module for SplType PHP extension. This extension aims at helping people making PHP a stronger typed language and can be a good alternative to scalar type hinting. It provides different typehandling classes as such as integer, float, bool, enum and string

1032.4k](/packages/ducks-project-spl-types)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
