NewWe open-sourced 50+ Laravel packages
Custom AI apps, agents and automation — Roundly ConsultingRoundly
All packages
QR for Laravel

Blade component

The <x-qr-code> component renders any string or Payload inline, or as an <img> with a data URI:

<x-qr-code data="https://example.com" />
<x-qr-code :data="$payment" :size="200" :margin="2" error-correction="Q" foreground="#111111"
           background="#ffffff" title="Scan to pay" description="Invoice 2026-0042" class="mx-auto" />
<x-qr-code data="https://example.com" as="img" class="w-40" />
  • Props — data (string or Payload), size, margin, error-correction, foreground, background, title, description, as (svg or img).
  • Attributes are allow-listed (class, style, id, data-*, aria-*); anything else, such as onclick, is dropped.
  • The generated markup is never compiled as a Blade template, so a title like {{ 7*7 }} renders escaped and no compiled view is written per code.

Renaming or disabling the tag

The tag name comes from qr.blade.component:

'blade' => ['component' => 'qr-code'],   // <x-qr-code>; null or blank (not set) disables it

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

By donating, you agree to our donation terms.

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.