pinkong/neteasy-yunxin
最新稳定版本:0.0.2
Composer 安装命令:
composer require pinkong/neteasy-yunxin
包简介
网易云信服务端sdk for laravel/lumen
README 文档
README
网易云信 服务端sdk for Laravel5 / Lumen. based on salamander-mh/YunXinHelper.
Installation
Require this package with composer by using the following command:
$ composer require pinkong/neteasy-yunxin
Then, add the service provider:
If you are using Laravel, add the service provider to the providers array in config/app.php:
[
'providers' => [
Pinkong\YunXin\YunXinServiceProvider::class,
],
]
as optional, you can use facade:
'aliases' => [ 'YunXinHelper' => Pinkong\YunXin\YunXinHelper::class, ],
If you are using Lumen, append the following code to bootstrap/app.php:
$app->register(Pinkong\YunXin\YunXinServiceProvider::class);
Configuration
The defaults are set in config/yunxin.php. Copy this file to your own config directory to modify the values. You can publish the config using this command:
php artisan vendor:publish --provider="Pinkong\YunXin\YunXinServiceProvider"
If you are using Lumen, append the following code to bootstrap/app.php:
$app->configure('yunxin');
Usage
用户
# 创建用户
YunXinHelper::user()->create($accid, $name, $icon);
# 用户基本信息更新
YunXinHelper::user()->update($accid, $token);
# 封禁用户
YunXinHelper::user()->block($accid);
# 解禁用户
YunXinHelper::user()->unblock($accid);
# 更新用户名片
YunXinHelper::user()->updateUserInfo($accid, $name, $icon);
# 批量获取用户名片
YunXinHelper::user()->getUserInfos($accids);
消息功能
# 文本消息
YunXinHelper::chat()->sendTextMsg($accidFrom, $to, $open, $text);
# 图片消息
YunXinHelper::chat()->sendPictureMsg($accidFrom, $to, $open,
$picName, $picMD5, $picUrl, $picExt, $picWidth, $picHeight, $picSize);
# 批量文本消息
YunXinHelper::chat()->sendTextBatchMsg($accidFrom, $accidsTo, $text);
# 发送自定义系统通知
YunXinHelper::chat()->sendAttachMsg($from, CHAT::CHAT_ONT_TO_ONE, $to, $attach);
License
The package is open-sourced software licensed under the MIT license.
统计信息
- 总下载量: 2.36k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2019-01-04