linkxtr / laravel-qrcode
A clean, modern, and easy-to-use QR code generator for Laravel
Requires
- php: ^8.2
- bacon/bacon-qr-code: ^3.0
- illuminate/contracts: ^12.0 || ^13.0
- illuminate/support: ^12.0 || ^13.0
Requires (Dev)
- chillerlan/php-qrcode: ^6.0
- ergebnis/composer-normalize: ^2.54
- laravel/pao: ^1.1
- laravel/pint: ^1.0
- orchestra/testbench: ^10.0 || ^11.0
- pestphp/pest: ^3.0 || ^4.0
- pestphp/pest-plugin-laravel: ^3.0 || ^4.0
- pestphp/pest-plugin-type-coverage: ^3.0 || ^4.0
- phpstan/phpstan: ^2.0
- rector/rector: ^1.0 || ^2.0
- spatie/invade: ^2.1
Suggests
- ext-gd: Required to generate PNG and WebP images via GD
- ext-imagick: Required to generate PNG and WebP images via Imagick
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-01 11:37:34 UTC
README
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
π¨ Visual Showcase Gallery
Every QR code below is an actual SVG generated directly by linkxtr/laravel-qrcode and verified with automated barcode decoding.
| 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 |
|
βοΈ Why linkxtr/laravel-qrcode?
| Feature | linkxtr/laravel-qrcode |
simplesoftwareio/simple-qrcode |
Raw endroid/qr-code |
|---|---|---|---|
| Active Maintenance | β Actively Maintained (v3.4.0) | β Abandoned (Last: Feb 2021) | β Active generic library |
| Laravel Compatibility | β Laravel 12 & 13 | β Laravel β€ 8 only | β οΈ Requires manual wiring |
| PHP Support | β PHP 8.2 β 8.5 | β PHP β€ 8.0 | β PHP 8.1+ |
| Underlying Engine | bacon/bacon-qr-code v3 |
bacon/bacon-qr-code v1/v2 |
Custom rasterizer / Bacon |
| 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 | β οΈ 5 basic payloads | β None built-in |
| Automated Scannability | β Every QR code decoded in CI | β None | β None |
| Quality & Coverage | β 100% Coverage & PHPStan Max | β Untyped legacy codebase | β οΈ Variable |
Drop-in Familiarity:
linkxtr/laravel-qrcodeis built onbacon/bacon-qr-codewith full Laravel idioms and drop-in familiarity forsimple-qrcodeusers. Transitioning requires zero mental overhead while gaining full immutability, type safety, and first-class Laravel 12 & 13 support.
β‘ 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.