Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Php Qrcode Laravel Package

chillerlan/php-qrcode

Generate and read QR codes in PHP. Supports Model 2 QR codes (versions 1–40), ECC levels L/M/Q/H, mixed encoding modes, and multiple output formats. Includes a QR code reader based on a PHP port of ZXing.

View on GitHub
Deep Wiki
Context7

QRInterventionImage

Class QRInterventionImage: intervention/image alternative GD/ImageMagick output.

Note: this output class works significantly slower than the native GD/Imagick output classes due to the several underlying abstraction layers. Use only if you must.

Example

See: intervention/image example

Set the options:

$options = new QROptions;

$options->outputInterface     = QRInterventionImage::class;
$options->scale               = 20;
$options->bgColor             = '#ccccaa';
$options->imageTransparent    = false;
$options->transparencyColor   = '#ccccaa';
$options->drawLightModules    = false;
$options->drawCircularModules = true;
$options->circleRadius        = 0.4;
$options->keepAsSquare        = [
	QRMatrix::M_FINDER_DARK,
	QRMatrix::M_FINDER_DOT,
	QRMatrix::M_ALIGNMENT_DARK,
];
$options->moduleValues        = [
	QRMatrix::M_FINDER_DARK    => '#A71111', // dark (true)
	QRMatrix::M_FINDER_DOT     => '#A71111', // finder dot, dark (true)
	QRMatrix::M_FINDER         => '#FFBFBF', // light (false)
	QRMatrix::M_ALIGNMENT_DARK => '#A70364',
	QRMatrix::M_ALIGNMENT      => '#FFC9C9',
	QRMatrix::M_VERSION_DARK   => '#650098',
	QRMatrix::M_VERSION        => '#E0B8FF',
];

Render the output:

$data = 'https://www.youtube.com/watch?v=dQw4w9WgXcQ';
$out  = new QRCode($options)->render($data); // -> data:image/png;base64,...

printf('<img alt="%s" src="%s" />', $alt, $out);

Return the ImageInterface instance (will ignore other output options):

$options->returnResource = true;

/** [@var](https://github.com/var) \Intervention\Image\Interfaces\ImageInterface $image */
$image = new QRCode($options)->render($data);

// do stuff with the ImageInterface instance...

// ...dump output

header('Content-type: image/png');

echo $image->toPng()->toString();

Set a different driver in the internal ImageManager instance (the internal detection order is: 1. GD, 2. Imagick):

$qrOutputInterface = new QRInterventionImage($options, $matrix);
// set a different driver
$qrOutputInterface->setDriver(new \Intervention\Image\Drivers\Imagick\Driver);
// dump output
$out = $qrOutputInterface->dump();

Additional methods

method return description
setDriver(DriverInterface $driver) static Sets a DriverInterface, see instantiation (intervention.io)
(protected) module() void Draws a single pixel at the given position

Options that affect this class

property type
$bgColor mixed
$circleRadius float
$drawCircularModules bool
$drawLightModules bool
$imageTransparent bool
$keepAsSquare array
$outputBase64 bool
$returnResource bool
$scale int
$transparencyColor mixed
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport