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

QRMarkupHTML

Class QRMarkupHTML: HTML output

This class is a cheap markup substitute for when SVG is not available or not an option (which was an issue before ca 2012). As a general rule: if you plan to display the QR Code in a web browser, you should be using the SVG output.

Example

See: HTML example

Set the options:

$options = new QROptions;

$options->outputInterface = QRMarkupHTML::class;
$options->cssClass        = 'qrcode';
$options->moduleValues    = [
	// finder
	QRMatrix::M_FINDER_DARK    => '#A71111', // dark (true)
	QRMatrix::M_FINDER_DOT     => '#A71111', // finder dot, dark (true)
	QRMatrix::M_FINDER         => '#FFBFBF', // light (false)
	// alignment
	QRMatrix::M_ALIGNMENT_DARK => '#A70364',
	QRMatrix::M_ALIGNMENT      => '#FFC9C9',
];

Output in a HTML document (via PHP):

<?php

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

header('Content-type: text/html');

?>
<!DOCTYPE html>
<html lang="none">
<head>
	<meta charset="UTF-8"/>
	<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
	<title>QRCode HTML Example</title>
	<style>
		div.qrcode{
			margin: 1em;
		}

		/* rows */
		div.qrcode > div {
			height: 10px;
		}

		/* modules */
		div.qrcode > div > span {
			display: inline-block;
			width: 10px;
			height: 10px;
		}
	</style>
</head>
<body>
<!-- php poutput -->
<?php echo $out; ?>
</body>
</html>

Additional methods

method return description
(protected) createMarkup(bool $saveToFile) string Returns the fully parsed and rendered markup string for the given input
(protected) getCssClass(int $M_TYPE = 0) string Returns a string with all css classes for the current element

Options that affect this class

property type
$cssClass string
$eol string
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