Search by

roundly-consulting / qr-for-laravel

mihaliak

Native QR codes for Laravel: an ISO/IEC 18004 encoder with optimal segmentation, one optimised SVG renderer, and typed payloads for otpauth 2FA, EPC SEPA transfers and PAY by square — zero third-party dependencies.

Package info

github.com/roundly-consulting/qr-for-laravel

pkg:composer/roundly-consulting/qr-for-laravel

Fund package maintenance!

Patreon

Statistics

Installs: 10

Dependents: 1

Suggesters: 1

Stars: 0

Open Issues: 0

1.0.0 2026-10-03 18:11 UTC

This package is auto-updated.

Last update: 2026-10-03 18:33:25 UTC


README

QR for Laravel — Roundly open source

Latest release Tests Code style Donate Patreon Crypto

QR for Laravel

Native QR codes for Laravel: an ISO/IEC 18004 encoder, one optimised SVG renderer, and typed payloads for 2FA setup codes, links, contacts, Wi-Fi, SEPA credit transfers (EPC069-12) and Slovak PAY by square payments. No third-party runtime libraries.

Installation

Requires PHP 8.4 (ext-mbstring, ext-bcmath) and Laravel 12 or 13.

composer require roundly-consulting/qr-for-laravel

Usage

Build a code fluently and render it as SVG — or return the builder from a route:

use RoundlyConsulting\Qr\Facades\Qr;

$svg = Qr::url('https://example.com/menu/12')
    ->size(240)
    ->errorCorrection('Q')
    ->title('Scan to order')
    ->svg();                                       // Svg value object, Htmlable

$svg->toString();                                  // the <svg> markup
Qr::url('https://example.com')->toDataUri();       // data:image/svg+xml;charset=utf-8,…

Route::get('/tables/{table}/qr', fn (Table $table) => Qr::url(route('menu', $table))); // image/svg+xml

Payments and 2FA enrolment codes are typed payloads too:

use RoundlyConsulting\Money\Money;
use RoundlyConsulting\Qr\Payloads\Payments\Epc\EpcPayment;

$payment = new EpcPayment(
    name: 'VetClinic s.r.o.',
    iban: 'SK96 1100 0000 0029 1859 9669',
    amount: Money::ofMinor(12550, 'EUR'),
    reference: 'RF18539007547034',
);

Qr::epc($payment)->svg();
Qr::otpauth($setup->provisioningUri)->svg();      // never cached, served with no-store

Or drop one into a view:

<x-qr-code :data="$payment" :size="200" title="Scan to pay" />

Documentation

The full documentation — configuration, every feature and its API, and testing — lives on our website: roundly-consulting.com/open-source/docs/qr-for-laravel

Release notes are in CHANGELOG.md. To contribute, see the contributing guide.

Support our work

This package is free and open source, built and maintained by Roundly Consulting. If it saves you time, please consider supporting our open-source work — a one-time donation, a monthly pledge on Patreon or a crypto donation helps fund maintenance, new features and new packages.

Donate to Roundly open source Become a patron on Patreon Donate crypto: BTC, ETH, BNB or SOL

License

The MIT License (MIT). See LICENSE.md.