PHPackages                             lslcoded/think-qrcode - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. lslcoded/think-qrcode

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

lslcoded/think-qrcode
=====================

qrcode for thinkphp5

2.0(2y ago)0542MITPHPPHP &gt;=5.4.0

Since Jan 10Pushed 2y ago1 watchersCompare

[ Source](https://github.com/lslcoded/think-qrcode)[ Packagist](https://packagist.org/packages/lslcoded/think-qrcode)[ Docs](https://github.com/lslcoded/think-qrcode)[ RSS](/packages/lslcoded-think-qrcode/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

think-qrcode
============

[](#think-qrcode)

The ThinkPHP5 qrcode 二维码生成 SDK

安装
--

[](#安装)

### 一、执行命令安装

[](#一执行命令安装)

```
composer require lslcoded/think-qrcode

```

或者

### 二、require安装

[](#二require安装)

##### thinkphp5.0 安装

[](#thinkphp50-安装)

```
"require": {
        "lslcoded/think-qrcode":"1.*"
},

```

##### thinkphp5.1 安装

[](#thinkphp51-安装)

```
"require": {
        "lslcoded/think-qrcode":"2.*"
},

```

或者

### 三、autoload psr-4标准安装

[](#三autoload-psr-4标准安装)

```
   a) 进入vendor/lslcoded目录 (没有lslcoded目录 mkdir lslcoded)
   b) git clone
   c) 修改 git clone下来的项目名称为think-qrcode
   d) 添加下面配置
   "autoload": {
        "psr-4": {
            "lslcoded\\qrcode\\": "vendor/lslcoded/think-qrcode/src"
        }
    },
    e) php composer.phar update

```

使用
--

[](#使用)

#### 添加配置文件

[](#添加配置文件)

```
return [
    'cache_dir' => 'uploads'.DS.'qrcode',           //缓存地址
    'background'=> 'static/image/icon_cover.png'    //背景图
];

```

#### 使用方法

[](#使用方法)

```
$code = new QRcode();
$code_path =  $code->png($register_url)         //生成二维码
    ->logo('static/image/avatar-m.jpg')         //生成logo二维码
    ->background(180,500)                       //给二维码加上背景
    ->text($role,20,['center',740],'#ff4351')   //添加文字水印
    ->text($nick_name,20,['center',780],'#000000')
    ->getPath();                                //获取二维码生成的地址

```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity36

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

854d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/af94858c8a17600ff5b1c79600ccbea25692229e929908a68e9e783f239ffd25?d=identicon)[lslcoded](/maintainers/lslcoded)

### Embed Badge

![Health badge](/badges/lslcoded-think-qrcode/health.svg)

```
[![Health](https://phpackages.com/badges/lslcoded-think-qrcode/health.svg)](https://phpackages.com/packages/lslcoded-think-qrcode)
```

PHPackages © 2026

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