qrcode基本使用
安装
1、在项目根目录下使用如下命令安装依赖包:
composer require simplesoftwareio/simple-qrcode 1.3.*
2、在 config/app.php (providers)中注册服务提供者:
SimpleSoftwareIO\QrCode\QrCodeServiceProvider::class
3、同样在 config/app.php ( Aliases)中添加 QrCode 门面:
‘QrCode’ => SimpleSoftwareIO\QrCode\Facades\QrCode::class
示例
$qrCodeImg = QrCode::size(200)
// ->color(255,0,255)
// ->backgroundColor(255,255,0)
->generate($url);
echo $qrCodeImg;
本作品采用《CC 协议》,转载必须注明作者和本文链接