zhan3333/tencentcloudapi

There is no license information available for the latest version (v1.0.0) of this package.

tencent cloud api

v1.0.0 2019-12-26 01:20 UTC

This package is auto-updated.

Last update: 2023-01-26 09:58:47 UTC


README

安装

composer require zhan3333/tencentcloudapi

配置

.env配置

TENCENT_SECRET_ID=
TENCENT_SECRET_KEY=

使用

use Zhan3333\Tencent\OCR;
use Zhan3333\Tencent\Request\OCRIdCardRequest;
use Zhan3333\Tencent\Response\OCRIdCardResponse;

$filePath = __DIR__ . '/files/id-card-front.jpg';
$request = new OCRIdCardRequest($filePath, OCRIdCardRequest::SIDE_FRONT);
/** @var OCRIdCardResponse $response */
$response = app(OCR::class)->execute($request);
dump($response);
dump($response->card);
dump($response->error_message);
dump($response->card->id_card_number);