keinx/think-qrcode

QR code generation for thinkphp6

Installs: 197

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 1

Forks: 0

Open Issues: 0

Type:think-extend

1.1 2022-01-01 11:57 UTC

This package is auto-updated.

Last update: 2024-04-29 04:48:09 UTC


README

QR code generation for thinkphp6

安装方法

composer require keinx/think-qrcode

配置方法

配置文件路径:/config/qrcode.php

  • cache_dir = 生成地址
  • background = 背景图片

使用方法

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