exeque / laravel-qr
QR codes for Laravel.
Requires
- php: ^8.5
- ext-mbstring: *
- guzzlehttp/psr7: ^2.9 || ^3.0
- laravel/framework: ^13.0
- psr/http-message: ^2.0
Requires (Dev)
- enshrined/svg-sanitize: ^1.1
- exeque/laravel-monocle: ^0.12
- larastan/larastan: ^3.13
- laravel/pint: ^1.21
- livewire/livewire: ^4.4
- orchestra/testbench: ^11.3
- pestphp/pest: ^5.0
- pestphp/pest-plugin-type-coverage: ^5.0
Suggests
- ext-gd: Draws PNG, JPEG and WebP codes without Imagick.
- ext-imagick: Draws PNG, JPEG and WebP codes faster than GD, and SVG logos on them.
- enshrined/svg-sanitize: Sanitizes SVG logos with a dedicated sanitizer instead of the package's own.
- exeque/laravel-monocle: Shows the codes each request rendered, with timings and advice, in the Monocle profiler.
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-28 05:52:17 UTC
README
Laravel QR
Documentation: exeque.github.io/laravel-qr
Customizable, scannable, beautiful QR codes for Laravel, and a reader to scan them back.
| 36 | 16 | 24 | 21 | 28 | 5 |
|---|---|---|---|---|---|
| module shapes | outer eyes | inner eyes | eye presets | filters | gradients |
Scan guards check that every styled code stays readable, and say what they changed.
use ExeQue\Qr\Facades\Qr; use ExeQue\Qr\Gradients\LinearGradient; Qr::url('https://example.com/e/ABCD1234') ->modules('flowing-medium') ->eyes('rounded') ->paint(LinearGradient::make('#be123c', '#1e1b4b')->angle(135)) ->png(600) ->store('codes/launch.png');
![]() |
![]() |
![]() |
![]() |
- Content - links, Wi-Fi logins, contact cards, email, text messages, places and calendar events, escaped the way phones read them; or any text, in any language.
- Shapes - thirty-six module shapes, from squares and dots to flowing, organic, connected, Christmas and Halloween modules; sixteen outer eyes, twenty-four inner eyes and twenty-one presets.
- Color - every CSS color space, your own color names, and linear, radial, conic, diamond and mesh gradients blended in OKLab.
- Filters - turn, size, nudge, shade, recolor or reshape every module on its own, in waves or from the middle out.
- Logos - from files, disks or bytes, on a plate, cut to a shape; SVG logos sanitized.
- Scan safety - guards that keep every styled code readable, and say what they changed.
- Output - SVG, PNG, JPEG and WebP; saved, stored, downloaded, streamed or returned as a response; with attribution written into the file.
- Blade -
<x-qr :content="$url" />, and icons of every shape for style pickers. - Validation -
StyleRulechecks a style from a form, field by field, and turns it into a style. - Translated - labels for every shape, preset, filter, gradient, kind of content and format, and the validation messages, in 29 languages.
- In the browser - a manifest of every part with its label, and a small module that checks colors as the scan guards do.
- Reading -
Qr::read()reads codes from images, with the package's own decoder or zxing. - Caching, a testing fake, events, a Monocle lens, artisan commands, and a Laravel Boost skill for AI agents.
Every built-in shape is checked with a real decoder, as SVG and as PNG.
Make it yours
Nearly everything is open to change. Register your own module shapes, eyes, filters, gradients, content types,
writers and decoders by name, and use them like the built-in ones; name whole styles in config and apply them with
->style('brand'); turn any shape's options, from corner radii to the way a drop points; or bind your own class in
place of any of the package's services. See Extending.
Install
composer require exeque/laravel-qr # The config, to change the defaults and name styles and parts of your own (optional) php artisan vendor:publish --tag=qr-config # Recommended # Imagick, for faster PNG, JPEG and WebP than GD (or your system's package, such as php8.5-imagick) pecl install imagick # SVG logos on PNG, JPEG and WebP codes: Alpine apk add imagemagick-svg # SVG logos on PNG, JPEG and WebP codes: Ubuntu 24.04 (Debian 13 has it already) apt install libmagickcore-6.q16-7-extra # HEIC, HEIF and AVIF logos: Alpine (Ubuntu and Debian have it already) apk add imagemagick-heic # The zxing reader, reading SVG too php artisan qr:install --svg # A dedicated sanitizer for SVG logos composer require enshrined/svg-sanitize # See the codes each request rendered, in the Monocle profiler composer require --dev exeque/laravel-monocle
PHP 8.5 and Laravel 13. SVG needs nothing more; PNG, JPEG and WebP need Imagick or GD.
To read codes with zxing, the most capable reader, install zxing-wasm with your package manager (found from your
lock file, or asked):
php artisan qr:install
Recommended
- The Imagick extension, for PNG, JPEG and WebP output: 10 to 40 % faster than GD, which is used without it, and needed for SVG logos on raster codes. ImageMagick 6 and 7 both work.
- ImageMagick's SVG support, to put SVG logos on PNG, JPEG and WebP codes:
imagemagick-svgon Alpine,libmagickcore-6.q16-7-extraon Ubuntu 24.04; Debian 13 has it with ImageMagick (libmagickcore-7.q16-10-extra). - Node.js with
zxing-wasm, throughphp artisan qr:install, to read codes with zxing; add--svgto read SVG images too. enshrined/svg-sanitize, to sanitize SVG logos with a dedicated sanitizer instead of the package's own allowlist.exeque/laravel-monocle, to see the codes each request rendered, with timings and advice.
Documentation
Start with Getting started, or the documentation index.
Thanks
To bacon/bacon-qr-code, for years of fantastic work on QR codes in PHP.
License
MIT, see LICENSE.md.




