PHP code example of pinkong / neteasy-yunxin

1. Go to this page and download the library: Download pinkong/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/ */

    

pinkong / neteasy-yunxin example snippets


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

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


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

php artisan vendor:publish --provider="Pinkong\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);