Skip to content

Commit 6d7f1ed

Browse files
author
link
committed
完善说明文档
1 parent 7129f8b commit 6d7f1ed

File tree

1 file changed

+51
-11
lines changed

1 file changed

+51
-11
lines changed

README.md

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
## 安装
55
加载包
66

7-
`"link1st/laravel-test": "dev-master"`
7+
`"link1st/laravel-easemob": "dev-master"`
88

99
在配置文件中添加 **config/app.php**
1010

@@ -13,27 +13,67 @@
1313
/**
1414
* 添加供应商
1515
*/
16-
link1st\test\TestServiceProvider::class,
16+
link1st\Easemob\EasemobServiceProvider::class,
1717
],
1818
'aliases' => [
1919
/**
2020
* 添加别名
2121
*/
22-
'test'=>link1st\test\Facades\Test::class,
22+
'Easemob' => link1st\Easemob\Facades\Easemob::class,
2323
],
2424
```
2525

2626
生成配置文件
2727

2828
`php artisan vendor:publish`
2929

30+
设置环信的参数 **config/easemob.php**
31+
32+
3033
## 使用
34+
- - -
35+
### 获取token
36+
`\Easemob::getToken();`
37+
38+
- - -
39+
### 开放注册用户
40+
`$user = \Easemob::publicRegistration('xiaoming1');`
41+
42+
### 授权注册 同一个用户只能注册一次
43+
`$user = \Easemob::authorizationRegistration('xiaoming1');`
44+
45+
### 批量注册
46+
```php
47+
$users = [
48+
['username'=>'xiaoming2','password'=>1],
49+
['username'=>'xiaoming3','password'=>1],
50+
];
51+
$user = \Easemob::authorizationRegistrations($users);
52+
```
53+
54+
- - -
55+
### 获取用户
56+
`$user = \Easemob::getUser('xiaoming1');`
57+
58+
### 获取app所有的用户
3159
```php
32-
// 使用自动加载直接使用
33-
$link = new \link1st\test\easemob();
34-
echo $link->get_config();
35-
36-
// 使用门面使用
37-
echo \test::get_config();
38-
echo \test::index();
39-
```
60+
$user = \Easemob::getUserAll(100,'LTgzNDAxMjM3OTprcFJFRUpzdUVlYWh5V1UwQjNSbldR');
61+
```
62+
63+
### 删除用户
64+
`$user = \Easemob::delUser('xiaoming1');`
65+
66+
### 修改用户密码
67+
`$user = \Easemob::editUserPassword('xiaoming2',111);`
68+
69+
### 修改昵称
70+
`$user = \Easemob::editUserNickName('xiaoming2',11);`
71+
72+
### 添加好友
73+
`$user = \Easemob::addFriend('xiaoming2','xiaoming3');`
74+
75+
### 删除用户
76+
`$user = \Easemob::delFriend('xiaoming2','xiaoming3');`
77+
78+
### 显示用户好友
79+
`$user = \Easemob::showFriends('xiaoming2');`

0 commit comments

Comments
 (0)