New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

linkxtr/laravel-qrcode

A clean, modern, and easy-to-use QR code generator for Laravel
54,403 41
Install
composer require linkxtr/laravel-qrcode
Latest Version:v3.4.0
PHP:^8.2
Laravel:12 · 13
Older releases:10 · 11
License:MIT
Last Updated:Nov 5, 2026
Links: GitHub  ·  Packagist
Maintainer: khaled-sadek

Laravel QR Code Generator

Latest Version on Packagist Total Downloads PHP Version Laravel Version Tests Code Coverage PHPStan Level Max Scannability: Decode-Verified License

linkxtr/laravel-qrcode is the actively maintained, modern QR code generator engineered specifically for Laravel 12 & 13 (and PHP 8.2–8.5). Built on the vector-native bacon/bacon-qr-code v3 engine, it pairs clean Laravel ergonomics with uncompromising engineering rigor—backed by an automated test suite that decodes and validates every generated QR code to prove real-world scannability.

📚 Read the Full Documentation


Every QR code below was generated directly by linkxtr/laravel-qrcode. The test suite decodes generated output back to its original payload on every CI run, so "it scans" is an assertion, not a hope.

Style Scannable Preview 3-Line Fluent Snippet
1. Classic Brand Color
Crisp brand foreground
Classic Brand QR Code
QrCode::size(300)
->color(30, 64, 175)
->generate('https://linkxtr.com');
2. Dot Modules + Circle Eyes
Modern rounded aesthetic
Dot Modules with Circle Eyes
QrCode::size(300)
->style('dot')->eye('circle')
->color(17, 24, 39)
->generate('https://linkxtr.com');
3. Diagonal Gradient
Vibrant two-tone transition
Diagonal Gradient QR Code
QrCode::size(300)
->gradient([99, 102, 241], [236, 72, 153], 'diagonal')
->eye('circle')
->generate('https://linkxtr.com');
4. Multi-Color Custom Eyes
Distinct corner branding
Multi-Color Custom Eyes
QrCode::size(300)
->color(31, 41, 55)
->eyeColor(0, [239, 68, 68], [153, 27, 27])
->eyeColor(1, [16, 185, 129], [6, 95, 70])
->generate('https://linkxtr.com');
5. Center Logo Merge
Embedded logo with high EC
Center Logo Merge QR Code
QrCode::size(300)
->errorCorrection('H')
->merge(public_path('images/logo.png'), 0.25)
->generate('https://linkxtr.com');

merge() expects a raster logo — point it at a PNG (or JPEG) that exists in your application; public_path('images/logo.png') is illustrative. An SVG logo throws ImageMergeException: Invalid image provided for merge when the output format is SVG, which is the default. Keep errorCorrection('H') so the payload survives the overlay.


⚖️ Why linkxtr/laravel-qrcode?

Feature linkxtr/laravel-qrcode simplesoftwareio/simple-qrcode Raw endroid/qr-code
Active Maintenance ✅ Actively Maintained (v3.4.0, Oct 2026) ⚠️ No release since Feb 2021 ✅ Active generic library
Laravel Compatibility ✅ Tested on Laravel 12 & 13 (CI matrix) ⚠️ No declared Laravel constraint; no CI ⚠️ Requires manual wiring
PHP Support ✅ PHP 8.2 – 8.5 (CI matrix) ⚠️ >=7.2 | ^8.0, no CI matrix ⚠️ Varies by version (latest 6.x needs 8.5)
Underlying Engine bacon/bacon-qr-code ^3 bacon/bacon-qr-code ^2 bacon/bacon-qr-code ^3 + GD-based writer
Immutable Fluent Builder ✅ Cloned instances (no leak) ❌ Mutable state leakage ⚠️ Partial builder pattern
Laravel Facade ✅ QrCode::... (Drop-in familiar) ✅ Legacy facade ❌ None
Native Blade Component ✅ <x-qr-code /> with accessible SVG ❌ None ❌ None
Artisan CLI Generator ✅ php artisan qr:generate ❌ None ❌ None
Laravel Cache Integration ✅ Built-in (cache(), TTL, stores) ❌ None ❌ None
Rich Data Types ✅ 12 built-in payloads ⚠️ 6 basic payloads ❌ None built-in
Automated Scannability ✅ Every QR code decoded in CI ❌ None ❌ None
Quality & Coverage ✅ 100% Coverage & PHPStan Max ❌ No static analysis or test matrix ⚠️ Variable

Coming from simple-qrcode? The fluent surface will feel familiar (QrCode::size()->generate()), but v3 does not ship a compatibility layer, so a handful of method names differ. The migration guide walks through each difference — it takes about ten minutes.

Comparison data verified against Packagist on 2026-11-05.


⚡ Quickstart

Install the package via Composer:

composer require linkxtr/laravel-qrcode

Optionally publish the configuration file:

php artisan vendor:publish --tag=qrcode-config

🛠️ Usage

1. The Fluent Facade

use Linkxtr\QrCode\Facades\QrCode;

$qr = QrCode::size(400)
    ->format('svg')
    ->color(30, 64, 175)
    ->errorCorrection('H')
    ->merge(public_path('logo.png'), 0.25)
    ->generate('https://example.com');

2. The Blade Component

Drop accessible QR codes directly into Blade views with zero PHP logic:

<x-qr-code
    data="https://example.com"
    size="300"
    color="#1E40AF"
    margin="2"
/>

The component automatically renders compliant SVG markup, inherits default settings from config/qrcode.php, and applies accessibility attributes (role="img", aria-label).

3. Interactive Artisan CLI

Generate QR codes straight from your terminal with interactive prompts:

php artisan qr:generate

Or pass flags directly:

php artisan qr:generate "https://example.com" --output="public/qr.svg" --format=svg --size=400

4. High-Performance Caching

Cache expensive QR code rendering seamlessly using Laravel's cache manager:

// Cache for the configured default TTL
QrCode::size(400)->cache()->generate('https://example.com');

// Cache for a custom TTL (in seconds) or DateInterval
QrCode::size(400)->cache(3600)->generate('https://example.com');

5. Rich Data Types

Built-in helpers format payloads according to international standards:

// Wi-Fi network configuration
QrCode::WiFi([
    'ssid' => 'OfficeNetwork',
    'encryption' => 'WPA2',
    'password' => 'secret-key',
]);

// Contact card (vCard / MeCard)
QrCode::VCard(
    name: 'Omar Fathy',
    phone: '+1234567890',
    email: 'omar@example.com',
    company: 'ApricotCake',
);

// Cryptocurrency payment
QrCode::BTC('bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh', 0.005);
QrCode::Ethereum('0x71C7656EC7ab88b098defB751B7401B5f6d8976F', 0.5);

// Direct messaging & communication
QrCode::Email('hello@example.com', 'Say Hi!');
QrCode::Telegram('username');
QrCode::WhatsApp('1234567890', 'Hello from Laravel!');
QrCode::SMS('1234567890', 'Verification Code');

📖 Documentation

For full installation guides, advanced customization (radial/diagonal gradients, CMYK color spaces, custom eye shapes), and macro registration, visit the official documentation:

👉 laravel-qrcode.mintlify.app


🚀 Upgrading to V3

If you are upgrading from simplesoftwareio/simple-qrcode or linkxtr/laravel-qrcode v1.x/v2.x, please refer to our Upgrade Guide for breaking changes and migration steps.


📄 License

The MIT License (MIT). Please see License File for more information.

Related Packages

tumutech/laravel-qr-code

Generate branded, scan-safe QR codes in Laravel with center logos, style templat...

25 0
abduns/laravel-qrcode

Laravel 12/13 bridge for abduns/qrcode: Facade, Blade, response()->qrcode(), and...

224 0
gabrielesbaiz/qrcode-toolkit

A style-first QR code toolkit for Laravel: module and eye shapes, gradients, log...

5,795 0
devtical/nova-qrcode-field

Nova QR code field

90,481 46
nathanmac/qr-code

Laravel package to providing a simple QR Code generator route

2,684 6

Version History

Version Released PHP Laravel License
v3.4.0 ^8.2 ^12.0 || ^13.0 MIT
v3.3.0 ^8.2 ^12.0 || ^13.0 MIT
v3.2.0 ^8.2 ^12.0|^13.0 MIT
v3.1.0 ^8.2 ^12.0|^13.0 MIT
v3.0.0 ^8.2 ^12.0|^13.0 MIT