nigr/chat
Composer 安装命令:
composer require nigr/chat
包简介
PHP chat library
README 文档
README
Install library:
composer require nigr/dotenv:@dev
Get started:
- Add routes;
- Create DB connection: ChatApi::setConnection($dsn, $username, $password);
- Call necessary method
Using routes:
- 'GET' - "getChats"(get all chats or get defined chats by params),
- 'POST'- "createChat"(create chat),
- 'GET' - "getMessages"(get all messages or get defined messages by params),
- 'POST'- "createMessage"(create message)
Prepare DB:
Chats:
- id: number
- lot_id: number
- contractor_id: number
- executor_id: number
- created_at?: timestamp
- updated_at?: timestamp
Messages:
- id: number AI
- chat_id: number
- owner: string
- text: string
- recipient?: string
- created_at?: timestamp
- updated_at?: timestamp
Data structure
- chat get = id?, lot_id?, contractor_id?, executor_id?
- chat post = lot_id, contractor_id, executor_id,
- message get = id?, chat_id?, owner?, text?, recipient?
- message post = chat_id, owner, text, recipient?
Returned data(JSON)
- ["status" => true, "message" => "!", "data" => [];
- ["status" => false, "message" => "!", "data" => [];
统计信息
- 总下载量: 8
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-20