Package Data | |
---|---|
Maintainer Username: | link1st |
Maintainer Contact: | link12stl@gmail.com (link1st) |
Package Create Date: | 2016-12-06 |
Package Last Update: | 2020-06-12 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-10 15:04:12 |
Package Statistics | |
---|---|
Total Downloads: | 6,474 |
Monthly Downloads: | 9 |
Daily Downloads: | 1 |
Total Stars: | 45 |
Total Watchers: | 3 |
Total Forks: | 18 |
Total Open Issues: | 0 |
环信即时通讯laravel包开发,用于环信用户、群、聊天室等功能
加载包
"link1st/laravel-easemob": "dev-master"
或
composer require link1st/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::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)