Package Data | |
---|---|
Maintainer Username: | zz98500 |
Package Create Date: | 2017-08-01 |
Package Last Update: | 2017-08-01 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-15 15:04:02 |
Package Statistics | |
---|---|
Total Downloads: | 112 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 0 |
Total Forks: | 0 |
Total Open Issues: | 0 |
环信及时通讯laravel包开发,用于环信用户、群、聊天室等功能 此版本修改于link1st的版本
加载包
"zz98500/laravel-easemob": "dev-master"
或
composer require zz98500/laravel-easemob
在配置文件中添加 config/app.php
'providers' => [
/**
* 添加供应商
*/
link1st\Easemob\EasemobServiceProvider::class,
],
'aliases' => [
/**
* 添加别名
*/
'Easemob' => link1st\Easemob\Facades\Easemob::class,
],
生成配置文件
php artisan vendor:publish
设置环信的参数 config/easemob.php
\Easemob::getToken();
$user = \Easemob::publicRegistration('xiaoming1');
$user = \Easemob::authorizationRegistration('xiaoming1');
$users = [
['username'=>'xiaoming2','password'=>1],
['username'=>'xiaoming3','password'=>1],
];
$user = \Easemob::authorizationRegistrations($users);
$user = \Easemob::getUser('xiaoming1');
$user = \Easemob::getUserAll(100,'LTgzNDAxMjM3OTprcFJFRUpzdUVlYWh5V1UwQjNSbldR');
$user = \Easemob::delUser('xiaoming1');
$user = \Easemob::editUserPassword('xiaoming2',111);
$user = \Easemob::editUserNickName('xiaoming2',11);
$user = \Easemob::disconnect('xiaoming2');
$user = \Easemob::addFriend('xiaoming2','xiaoming3');
$user = \Easemob::delFriend('xiaoming2','xiaoming3');
$user = \Easemob::showFriends('xiaoming2');
\Easemob::uploadFile($file_path);
\Easemob::downloadFile($uuid, $share_secret);
\Easemob::sendMessageText($users, $target_type = 'users', $message = "", $send_user = 'admin', $ext = []);
\Easemob::sendMessageImg($users, $target_type = 'users', $uuid, $share_secret, $file_name, $width = 480, $height = 720, $send_user = 'admin');
\Easemob::sendMessageAudio($users, $target_type = 'users', $uuid, $share_secret, $file_name, $length = 10, $send_user = 'admin');
\Easemob::sendMessageVideo($users, $target_type = 'users', $video_uuid, $video_share_secret, $video_file_name, $length = 10, $video_length = 58103, $img_uuid, $img_share_secret, $send_user = 'admin');
\Easemob::sendMessagePNS($users, $target_type = 'users', $action = "", $send_user = 'admin');
\Easemob::getChatMessages($time = '20170801');
\Easemob::groups($group_ids);
\Easemob::groupCreate($group_name, $group_description = '描述', $owner_user, $members_users = [], $is_public = true, $max_user = 200, $is_approval = true)
\Easemob::groupEdit($group_id, $group_name = "", $group_description = "", $max_user = 0)
\Easemob::groupDel($group_id)
\Easemob::groupUsers($group_id)
\Easemob::groupAddUsers($group_id, $users)
\Easemob::groupDelUsers($group_id, $users)
\Easemob::userToGroups($user)
\Easemob::groupTransfer($group_id, $new_owner_user)
\Easemob::room($room_id)
\Easemob::roomCreate($room_name, $owner_name, $room_description = "描述", $max_user = 200, $member_users = [])
\Easemob::roomDel($room_id)
\Easemob::roomEdit($room_id, $room_name = "", $room_description = "", $max_user = 0)
\Easemob::userToRooms($user)
\Easemob::roomAddUsers($room_id, $users)
\Easemob::roomDelUsers($room_id, $users)