---
title: "QR for Laravel docs — SVG, SEPA and PAY by square codes | Roundly"
description: "Developer docs for QR for Laravel: ISO/IEC 18004 encoder, SVG output, 2FA, Wi-Fi and vCard payloads, SEPA EPC and PAY by square payment codes."
url: https://roundly-consulting.com/open-source/docs/qr-for-laravel
language: en
---

[All packages](https://roundly-consulting.com/open-source.md)

Open source

# QR for Laravel

Install

`composer require roundly-consulting/qr-for-laravel`

Requires: PHP ^8.4 · Laravel ^12.0|^13.0

[GitHub](https://github.com/roundly-consulting/qr-for-laravel) [Packagist](https://packagist.org/packages/roundly-consulting/qr-for-laravel) [Donate (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Patreon](https://www.patreon.com/cw/roundly)

## Overview

Native QR codes for Laravel: an ISO/IEC 18004 encoder, one optimised SVG renderer, and typed payloads for links, contacts, Wi-Fi, 2FA setup codes, SEPA credit transfers (EPC069-12) and Slovak PAY by square payments. Invalid content is refused before a code is drawn, and secrets such as 2FA seeds are never cached. Everything is implemented inside the package — no third-party QR, image or compression library, only Laravel and Roundly’s own companion packages. MIT-licensed.

### What you get

#### Native ISO/IEC 18004 encoder

QR Code Model 2, versions 1–40, levels L/M/Q/H, optimal numeric/alphanumeric/byte/kanji segmentation and ECI 26 for UTF-8.

#### One optimised SVG

A single even-odd path with an exact viewBox — square, rounded or dot modules, rounded finders and an accessible title and description.

#### Typed payloads

Text, URL, e-mail, phone, SMS, Wi-Fi, vCard, geo and otpauth — validated before a code is drawn, without leaking the value into errors.

#### SEPA & PAY by square

EPC069-12 v3.1 credit transfers and PAY by square 1.0.0–1.2.0 orders, standing orders and direct debits — encode and decode.

#### Banking primitives

IBAN, BIC and ISO 11649 creditor reference value objects, validation rules and an AsIban Eloquent cast.

#### Sensitivity-aware caching

2FA seeds and Wi-Fi passwords are never memoised, cached or served cacheably; public codes get ETags and an optional SVG cache.

#### Facade or DI, Laravel-native output

Call the Qr facade or inject QrFactory; return a code from a controller, drop <x-qr-code> into Blade, embed a data URI or run qr:make.

### Documentation

#### [Installation](https://roundly-consulting.com/open-source/docs/qr-for-laravel/installation.md)

Install via Composer — no migrations, no routes; optionally publish the config and the translations.

#### [Configuration](https://roundly-consulting.com/open-source/docs/qr-for-laravel/configuration.md)

Every config key, default and env variable — error correction, versions, SVG styling, caching, Blade and payment standards.

#### [The Qr facade](https://roundly-consulting.com/open-source/docs/qr-for-laravel/facade.md)

Every method on the Qr facade — typed payload entry points, one-call svg/matrix/info shortcuts and the cheap fits() capacity check.

#### [Without the facade](https://roundly-consulting.com/open-source/docs/qr-for-laravel/without-facade.md)

Inject the QrFactory contract instead of calling the Qr facade — the same API as an explicit constructor dependency, with no static calls.

#### [Quick start](https://roundly-consulting.com/open-source/docs/qr-for-laravel/quick-start.md)

Render a QR code in Blade, as an Svg object, as a data URI, or return it straight from a route as an image response.

#### [Builder & options](https://roundly-consulting.com/open-source/docs/qr-for-laravel/builder.md)

The immutable PendingQr builder — error correction, versions, masks, segmentation, styling, the QrOptions form and option precedence.

#### [Payloads](https://roundly-consulting.com/open-source/docs/qr-for-laravel/payloads.md)

Typed payloads for text, links, e-mail, phone, SMS, Wi-Fi, vCard and geo — validated before a code is drawn.

#### [Custom payloads](https://roundly-consulting.com/open-source/docs/qr-for-laravel/custom-payloads.md)

Implement the Payload contract for your own content — tickets, labels — with its own requirements and sensitivity.

#### [2FA enrolment codes](https://roundly-consulting.com/open-source/docs/qr-for-laravel/two-factor.md)

Render an existing otpauth:// URI unchanged, or build TOTP/HOTP URIs — always treated as secrets.

#### [SEPA credit transfer (EPC)](https://roundly-consulting.com/open-source/docs/qr-for-laravel/sepa-transfers.md)

EPC069-12 v3.1 SEPA credit-transfer codes (GiroCode) — arguments, charsets, BIC rules and parsing scanned payloads.

#### [PAY by square](https://roundly-consulting.com/open-source/docs/qr-for-laravel/pay-by-square.md)

Slovak PAY by square codes (spec 1.0.0–1.2.0) — payment orders, standing orders and direct debits, encode and decode.

#### [Banking primitives](https://roundly-consulting.com/open-source/docs/qr-for-laravel/banking.md)

IBAN, BIC and ISO 11649 creditor-reference value objects — parse, validate, format and generate check digits.

#### [Validation rules & cast](https://roundly-consulting.com/open-source/docs/qr-for-laravel/validation.md)

Form rules for IBAN, BIC, creditor references and QR capacity, plus an AsIban Eloquent cast.

#### [SVG output & styling](https://roundly-consulting.com/open-source/docs/qr-for-laravel/svg-rendering.md)

One deterministic, accessible SVG path — module and finder styles, colours, responsive sizing and the Svg value object.

#### [Responses & data URIs](https://roundly-consulting.com/open-source/docs/qr-for-laravel/responses.md)

Return codes as hardened image/svg+xml responses, force downloads, embed data URIs and img tags, and build a safe host route.

#### [Blade component](https://roundly-consulting.com/open-source/docs/qr-for-laravel/blade-component.md)

Drop <x-qr-code> into any view — inline SVG or an img tag, with allow-listed attributes and no template compilation.

#### [Sensitivity & caching](https://roundly-consulting.com/open-source/docs/qr-for-laravel/sensitivity-caching.md)

Public, Personal and Secret payloads — what gets memoised, cached and served cacheably, and how to override it.

#### [Low-level encoder](https://roundly-consulting.com/open-source/docs/qr-for-laravel/encoder.md)

Drive the ISO/IEC 18004 encoder directly — explicit segments, capacity, masks, and the QrMatrix and EncodingInfo objects.

#### [Errors & translations](https://roundly-consulting.com/open-source/docs/qr-for-laravel/errors.md)

One exception hierarchy with stable reason keys, translatable user-facing messages, and the publishable translation file.

#### [Artisan commands](https://roundly-consulting.com/open-source/docs/qr-for-laravel/commands.md)

Render SVG files or inspect a code’s version, level, mask and bit budget from the command line with qr:make.

#### [Testing](https://roundly-consulting.com/open-source/docs/qr-for-laravel/testing.md)

Assert on real output — decode matrices with MatrixDecoder, check Qr::info() and Qr::fits(), and test response headers over HTTP.

#### [Requirements](https://roundly-consulting.com/open-source/docs/qr-for-laravel/requirements.md)

PHP 8.4+ with ext-mbstring and ext-bcmath, Laravel 12 or 13; ext-intl optional for payment-text normalisation.

## Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

[More ways to support, including crypto](https://roundly-consulting.com/support-us.md)

By donating, you agree to our [donation terms](https://roundly-consulting.com/donation-terms.md).

[Support our open source work (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Join us on Patreon (opens in a new tab)](https://www.patreon.com/cw/roundly)

## Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.

[Get a quote in 48 hours](https://roundly-consulting.com/contact.md) [Browse all packages](https://roundly-consulting.com/open-source.md)
