PHP code example of chenjiacheng / hyperf-tim
1. Go to this page and download the library: Download chenjiacheng/hyperf-tim 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/ */
chenjiacheng / hyperf-tim example snippets
declare(strict_types=1);
namespace App\Controller;
use Chenjiacheng\HyperfTim\Tim;
class TimController extends AbstractController
{
public function testImport(Tim $tim)
{
// 第一种方式
$result1 = $tim->account->import('101');
var_dump($result1);
// 第二种方式
$result2 = make(Tim::class)->account->import('102');
var_dump($result2);
// 第三种方式
$result3 = make(\Chenjiacheng\Tim\Tim::class)->account->import('103');
var_dump($result3);
return [];
}
}
bash
php bin/hyperf.php vendor:publish chenjiacheng/hyperf-tim