---
title: "Quick start — QR for Laravel | Roundly"
description: "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."
url: https://roundly-consulting.com/open-source/docs/qr-for-laravel/quick-start
language: en
---

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

[QR for Laravel](https://roundly-consulting.com/open-source/docs/qr-for-laravel.md)

# Quick start

Every entry point on the Qr facade returns a PendingQr builder. It is Htmlable, Responsable and Stringable, so the same object renders in Blade, becomes an HTTP response, or produces an Svg value object:

```php
use RoundlyConsulting\Qr\Facades\Qr;

// Blade: {{ }} renders the SVG unescaped (PendingQr and Svg are Htmlable)
{{ Qr::url('https://example.com/pets/Ab3x') }}

$svg = Qr::text('Table 12 — scan to order')->size(240)->margin(2)->svg();   // Svg value object
$markup = $svg->toString();
$uri = Qr::text('hello')->toDataUri();                                        // data:image/svg+xml;charset=utf-8,…

// Controllers: return the builder; it becomes an image/svg+xml response
Route::get('/tables/{table}/qr', fn (Table $table) => Qr::url(route('menu', $table)));
```

Returned from a controller, the builder becomes an image/svg+xml response with caching headers chosen by the payload’s sensitivity — see Responses and Sensitivity & caching. Prefer constructor injection? Type-hint QrFactory — see DI without the facade.

## 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/docs/qr-for-laravel.md)
