Search by

linkxtr / laravel-qrcode

khaled-sadek

A clean, modern, and easy-to-use QR code generator for Laravel

Package info

github.com/Linkxtr/laravel-qrcode

pkg:composer/linkxtr/laravel-qrcode

Statistics

Installs: 53 727

Dependents: 0

Suggesters: 0

Stars: 41

Open Issues: 0

v3.4.0 2026-10-29 15:37 UTC

README

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

🎨 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
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('vendor/linkxtr/logo.png'), 0.25)
->generate('https://linkxtr.com');

βš–οΈ 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-qrcode is built on bacon/bacon-qr-code with full Laravel idioms and drop-in familiarity for simple-qrcode users. 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.