PHP code example of laozhangren / neteasy-yunxin

1. Go to this page and download the library: Download laozhangren/neteasy-yunxin library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

laozhangren / neteasy-yunxin example snippets


[
    'providers' => [
        LaoZhangRen\YunXin\YunXinServiceProvider::class,
    ],
]

    'aliases' => [
        'YunXinHelper' => LaoZhangRen\YunXin\YunXinHelper::class,
    ],


$app->register(LaoZhangRen\YunXin\YunXinServiceProvider::class);

php artisan vendor:publish --provider="LaoZhangRen\YunXin\YunXinServiceProvider"


$app->configure('yunxin');

# 创建用户
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);