### Install QR for Laravel with Composer Source: https://github.com/roundly-consulting/qr-for-laravel/blob/main/README.md Requires PHP 8.4 with ext-mbstring and ext-bcmath, and Laravel 12 or 13. ```bash composer require roundly-consulting/qr-for-laravel ``` -------------------------------- ### Generate and render QR codes as SVG Source: https://github.com/roundly-consulting/qr-for-laravel/blob/main/README.md Build a QR code fluently using the Qr facade, render it as an SVG value object, convert to a data URI, or return it directly from a route. The SVG is Htmlable and can be output as a string. ```php 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 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 ``` -------------------------------- ### Create typed payloads for EPC payments and 2FA Source: https://github.com/roundly-consulting/qr-for-laravel/blob/main/README.md Instantiate an EpcPayment with named arguments and render it as SVG. The otpauth payload is never cached and is served with a no-store header. ```php 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 ``` -------------------------------- ### Embed QR code in a Blade view Source: https://github.com/roundly-consulting/qr-for-laravel/blob/main/README.md Use the x-qr-code component to render a QR code in a Blade template, passing the data payload, size, and an optional title. ```blade ```