superzc/qqconnect

1.0.1 2023-12-13 10:06 UTC

This package is auto-updated.

Last update: 2024-11-18 04:31:59 UTC


README

Latest Version on Packagist Release Version

This package provides additional features to the Laravel framework.

Installation

You can install the package via composer:

composer require superzc/qqconnect

Usage

修改QQ互联配置文件config/qqconnect.php

return [
    'appid' => 'xxx',
    'appkey' => 'xxx',
    'callback' => 'https://example.com/qc_redirect.html',
];

调用类方法

use Superzc\QQConnect\QQConnect;
use Superzc\QQConnect\Exceptions\DefaultException as QCException;

try {
    $qqconnect = new QQConnect();
    $qqconnect->init($openid, $access_token);
    $result = $qqconnect->doSomething();
} catch (MPDefaultException $e) {
    return response()->json([
        'ret' => $e->getCode(),
        'msg' => $e->getMessage(),
    ]);
}

使用门面

use Superzc\QQConnect\Facades\QQConnect;

try {
    QQConnect::init($openid, $access_token);
    $result = QQConnect::doSomething();
} catch (QCException $e) {
    return response()->json([
        'ret' => $e->getCode(),
        'msg' => $e->getMessage(),
    ]);
}

Change log

暂无