PHP code example of suunnn / laravel-rongcloud

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

    

suunnn / laravel-rongcloud example snippets


'providers' => [
    /*
     * Package Service Providers...
     */
     Suunnn\LaravelRongcloud\ServiceProvider::class,
],

'aliases' => [
    ...
    'RongCloud' => Suunnn\LaravelRongcloud\Facades\RongCloud::class,
],

return [
    'app_key' => 'your app key',
    'app_secret' => 'your app secret'
];



namespace App\Http\Controllers;

use Illuminate\Http\Request;
use RongCloud;
use Illuminate\Routing\Controller;

class UserController extends Controller
{
    public function store(Request $request)
    {
        $user = [
            'id' => 'USER01',
            'name' => 'PHPSDK', //用户名称
            'portrait' => '' //用户头像
        ];

        $token = RongCloud::getUser()->register($user);
    }
}