composer require chillerlan/php-qrcode
$data = 'id=100&barn_id=125';
$QRCode = new QRCode();
$img_content = $QRCode->render($data);
$img_content = str_replace('data:image/png;base64,', '', $img_content);
return response(base64_decode($img_content), 200, ['Content-Type' => 'image/png']);
好用~~
如何修改二维码颜色?
收藏了
兄弟,出个简单文档呀,改改颜色 大小啥的,中间logo啥的
https://github.com/chillerlan/php-qrcode 这个是扩展的地址
需要那些扩展呢?
PHP 8.2+
ext-mbstring
optional:
ext-gd
ext-imagick with ImageMagick installed
ext-fileinfo (required by QRImagick output)
setasign/fpdf for the PDF output module
intervention/image for alternative GD/ImageMagick output 这些都要吗?