我自己封裝的 Laravel 融雲 sdk,簡單好用

18874127314發表於2020-05-08

laravel融雲sdk 要求laravel>=5.5,基於融雲官方sdk(https://github.com/rongcloud/server-sdk-php-composer)

Installing

$ composer require liujun/laravel-rongcloud -vvv

Usage

在config目錄下的services.php加上如下配置

    'rongcloud' => [ //融雲IM配置
        'app_key' => 'xxxxx',
        'app_secret' => 'xxxxxx',
    ],

使用說明

<?php 

use use Liujun\LaravelRongcloud\Facades\Rongcloud;

$user = [
    'id'=> '1',
    'name'=> '小叮噹',//使用者名稱稱
    'portrait'=> 'http://7xogjk.com1.z0.glb.clouddn.com/IuDkFprSQ1493563384017406982', //使用者頭像
];
$rongUser = Rongcloud::getUser()->register($user); //註冊使用者
dump($rongUser);
$rongUser = Rongcloud::getUser()->update($user); //更新使用者
dump($rongUser);

API文件

Contributing

You can contribute in one of three ways:

1. File bug reports using the issue tracker.
2. Answer questions or fix bugs on the issue tracker.
3. Contribute new features or update the wiki.

The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.

License

MIT

本作品採用《CC 協議》,轉載必須註明作者和本文連結

相關文章