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
- 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
README
A clean, fluent, and modern QR code generator for Laravel. Generate SVG, PNG, WebP, and EPS codes via a fluent Facade, a native Blade component, or an interactive Artisan CLI.
📚 Read the Full Documentation
âš¡ Quickstart
Install the package via Composer:
composer require linkxtr/laravel-qrcode
The Fluent Facade
use Linkxtr\QrCode\Facades\QrCode; $qr = QrCode::size(400) ->format('png') ->color(30, 64, 175) ->errorCorrection('H') ->merge(public_path('logo.png'), 0.25) ->generate('https://example.com');
The Blade Component
Drop QR codes directly into your views with zero PHP logic. It automatically handles accessibility (aria-label) and escaping:
<x-qr-code data="https://example.com" size="300" color="#1E40AF" margin="2" />
Rich Data Types
Built-in helpers for standardized payloads:
QrCode::WiFi([ 'ssid' => 'OfficeNetwork', 'encryption' => 'WPA2', 'password' => 'secret' ]); QrCode::Email('hello@example.com', 'Say Hi!'); QrCode::BTC('bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh', 0.005);
📖 Documentation
For full installation instructions, detailed customization options (gradients, CMYK, custom eye shapes), and advanced macro usage, please visit the official documentation:
👉 laravel-qrcode.mintlify.app
🚀 Upgrading to V3
If you are upgrading from v1.x or v2.x, please refer to our Upgrade Guide for a complete list of breaking changes and migration steps.
📄 License
The MIT License (MIT). Please see License File for more information.