Giter Club home page Giter Club logo

laravel-yunxin's Introduction

安装

$ composer require biubiujun/yunxin

配置

Laravel

config/app.php中注册 ServiceProvider 和 Facade

'providers' => [
    Biubiujun\Yunxin\YunxinServiceProvider::class,
],
'aliases' => [
    'Yunxin' => Biubiujun\Yunxin\Facades\YunxinIM::class,
],

发布配置文件

php artisan vendor:publish --provider="Biubiujun\Yunxin\YunxinServiceProvider"

Lumen

bootstrap/app.php中添加

$app->register(Biubiujun\Yunxin\YunxinServiceProvider::class);

使用

用户

支持所有用户类接口
方法名为网易云信中接口名
创建网易云信通信ID https://api.netease.im/nimserver/user/create.action

YunxinIM::user()
    ->setAccId($accId)
    ->setName($name)
    ->setIcon($icon)
    ->create();

or

YunxinIM::user()
    ->setParameter('accid', $accId)
    ->setParameter('name', $name)
    ->setParameter('icon', $icon)
    ->create();

聊天室

创建聊天室 https://api.netease.im/nimserver/chatroom/create.action

YunxinIM::chatRoom()
    ->setCreator($creator)
    ->setName($name)
    ->setAnnouncement($announcement)
    ->create();

or

YunxinIM::chatRoom()
    ->setParameter('creator', $creator)
    ->setParameter('name', $name)
    ->setParameter('announcement', $announcement)
    ->create();

laravel-yunxin's People

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.