linkxtr/laravel-qrcode
| 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 |
Laravel QR Code Generator
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.
🎨 Visual Showcase Gallery
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 |
|
|
| 2. Dot Modules + Circle Eyes Modern rounded aesthetic |
|
|
| 3. Diagonal Gradient Vibrant two-tone transition |
|
|
| 4. Multi-Color Custom Eyes Distinct corner branding |
|
|
| 5. Center Logo Merge Embedded logo with high EC |
|
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 throwsImageMergeException: Invalid image provided for mergewhen the output format is SVG, which is the default. KeeperrorCorrection('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:
🚀 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
Generate branded, scan-safe QR codes in Laravel with center logos, style templat...
Laravel 12/13 bridge for abduns/qrcode: Facade, Blade, response()->qrcode(), and...
A style-first QR code toolkit for Laravel: module and eye shapes, gradients, log...
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v3.4.0 | ^8.2 | ^12.0 || | MIT | |
| v3.3.0 | ^8.2 | ^12.0 || | MIT | |
| v3.2.0 | ^8.2 | ^12.0| | MIT | |
| v3.1.0 | ^8.2 | ^12.0| | MIT | |
| v3.0.0 | ^8.2 | ^12.0| | MIT | |
| v2.5.1 | ^8.2 | ^11.0| | MIT | |
| v2.5.0 | ^8.2 | ^11.0| | MIT | |
| v2.4.0 | ^8.2 | ^11.0| | MIT | |
| v2.3.0 | ^8.2 | ^11.0| | MIT | |
| v2.2.0 | ^8.2 | ^11.0| | MIT | |
| v2.1.1 | ^8.2 | ^11.0| | MIT | |
| v2.1.0 | ^8.2 | ^11.0| | MIT | |
| v2.0.0 | ^8.2 | ^11.0| | MIT | |
| v1.0.1 | ^8.2 | ^10.0| | MIT | |
| v1.0.0 | ^8.2 | ^10.0| | MIT |