PHPackages                             zev/ali-id-card-ocr - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. zev/ali-id-card-ocr

ActiveLibrary[API Development](/categories/api)

zev/ali-id-card-ocr
===================

Ali-id-card-ocr is a laravel package for ID card identification verification through Alibaba Cloud's open API

217PHP

Since Apr 20Pushed 7y agoCompare

[ Source](https://github.com/zevgithub/ali-id-card-ocr)[ Packagist](https://packagist.org/packages/zev/ali-id-card-ocr)[ RSS](/packages/zev-ali-id-card-ocr/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Description
-----------

[](#description)

- Ali-idcard-ocr is a laravel package for ID card identification verification through Alibaba Cloud's open API

App Code
--------

[](#app--code)

- Please apply for your `app_code ` before use.

key words
---------

[](#key-words)

- Key words: 印刷文字识别-身份证识别

Install
-------

[](#install)

```
composer require zev/ali-id-card-ocr

```

Quick Start
-----------

[](#quick-start)

```
namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Zev\AliIdCardOcr\IdCardOCR\AliIdCardOCR;

class ExampleController extends  Controller
{

    /**
    * Identification verification face/back and compare user input information
    * 识别验证-正/反面-并比对用户输入信息
    *
    * @param Request $request
    * @param string $side- face|back
    * @param bool $isBase64 | default false
    * @return array|\Illuminate\Http\JsonResponse|string
    */
    public function ocrTest(Request $request)
    {
        // $face and $back is the face and back file name
        $res = AliIdCardOCR::idCardVerify(
            $request->username,
            $request->idNum,
            $face,
            $back,
            $isBase64 = false);

        return $res;
    }

    /**
    * Only Identification verification face/back
    * 仅识别验证正/反面信息
    *
    * @param Request $request
    * @param string $side- face|back
    * @param string $file | file or base64
    * @param bool $base64 | default false
    * @return array|\Illuminate\Http\JsonResponse|string
    */

    public function sideOcrTest($side, $file, $base64 = false)
    {
        $res = AliIdCardOCR::IdVerify($side, $fileName, $base64)

        return $res;
    }

}

```

Custom configuration
--------------------

[](#custom-configuration)

```
php artisan vendor:publish --provider="Zev\AliIdCardOcr\AliIdCardOcrServiceProvider"
//or usage
php artisan vendor:publish --tag=aliIdCardOCR-config

//Custom config
return [

    // Request URL
    'ocr_url'  => env('OCR_URL','https://dm-51.data.aliyun.com/rest/160601/ocr/ocr_idcard.json'),

    // Your AppCode
    'app_code'  => env('OCR_APP_CODE','your-app-code'),

    // the face and back file the storage path of face and back file
    'file_path'  => storage_path('app/public/upload/')

     // Whether to return identity information
    'is_identity_return' => env('IS_IDENTITY_RETURN', false),

];

```

Application address
-------------------

[](#application-address)

- [https://market.aliyun.com/products/57124001/cmapi010401.html?spm=5176.730005-56956004-57124001.aliyun\_market\_list\_right.5.47ad3524pZtEx3](https://market.aliyun.com/products/57124001/cmapi010401.html?spm=5176.730005-56956004-57124001.aliyun_market_list_right.5.47ad3524pZtEx3)

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/060b713dccc6f9481ef4ceb8cef812ddfbe49b55c89c323d42c92bdaae2ba590?d=identicon)[zev](/maintainers/zev)

### Embed Badge

![Health badge](/badges/zev-ali-id-card-ocr/health.svg)

```
[![Health](https://phpackages.com/badges/zev-ali-id-card-ocr/health.svg)](https://phpackages.com/packages/zev-ali-id-card-ocr)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
