PHP code example of quhang / laravel-easemob

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

    

quhang / laravel-easemob example snippets


registerregister($username, $password, $nickname = '', $authorization = false)


// 开放注册
Easemob::user()->register('username1', '123456')

// 授权注册
Easemob::user()->register('username1', '123456', '', false)
或
Easemob::user()->authorizeRegister('username1', '123456')

update(array $attributes)

Easemob::chatgroup('21437472636929')->update([
    'groupname' => 'jooo in us',
    'description' => 'nothing',
    'maxusers' => 300
])

addMuteUsers(array $users, $time = 60) // $time 单位分钟
Easemob::chatGroup('21437472636929')->addMuteUsers(['username6'])