Search by

reyesoft / crypto-qr

pablorskjagannath23

This library helps to generate QR codes for Crypto Address

Package info

github.com/reyesoft/crypto-qr

pkg:composer/reyesoft/crypto-qr

Statistics

Installs: 69 479

Dependents: 0

Suggesters: 0

Stars: 6

Open Issues: 1

2.2.0 2026-10-15 22:19 UTC

README

By Reyesoft

This library generates PNG QR codes for cryptocurrency addresses using chillerlan/php-qrcode.

Installation

Use Composer to install the library.

$ composer require reyesoft/crypto-qr

Basic usage

use CryptoQr\BitcoinQr;

$qr = new BitcoinQr('3PrCdjyjcDHDSC8tvVgx1u96tMK9juncHs');

header('Content-Type: image/png');
echo $qr->getString();

Advanced usage

use CryptoQr\BitcoinQr;

// Create a basic QR code
$qr = new BitcoinQr('3PrCdjyjcDHDSC8tvVgx1u96tMK9juncHs');
$qr->setSize(300);
$qr->setAmount(0.01);
$qr->setLabel('Caritas');
$qr->setMessage('Donation for project Maria');

// Directly output the QR code
header('Content-Type: image/png');
echo $qr->getString();

// Save it to a file
$qr->writeFile(__DIR__.'/qrcode.png');

bitcoin qr

Testing

composer test
sh autofix.sh

PHP 8.4

docker run -it --rm --name php84 -e PHP_EXTENSIONS="gd" -v "$PWD":/usr/src/app thecodingmachine/php:8.4-v4-cli bash