Download the PHP package tumutech/laravel-qr-code without Composer
On this page you can find all versions of the php package tumutech/laravel-qr-code. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tumutech/laravel-qr-code
More information about tumutech/laravel-qr-code
Files in tumutech/laravel-qr-code
Package laravel-qr-code
Short Description Generate branded, scan-safe QR codes in Laravel with center logos, style templates, Blade, and Inertia data URIs
License MIT
Homepage https://github.com/tumutech/laravel-qr-code
Informations about the package laravel-qr-code
Laravel QR Code
Easy-to-use branded, scan-safe QR codes for Laravel 10–12. Center logos, named style templates, Blade, storage, and data URIs for Inertia — without Imagick. Install, call the facade, done.
Laravel auto-discovers the package. No extra setup. If anything goes wrong, open a GitHub issue and we will take a look.
What it offers
- Laravel 10, 11, and 12 (CI on PHP 8.2–8.4)
- Center brand logo with a padded punchout so modules do not show through
scanSafe()— contrast, quiet zone, and logo-size checks before you ship- Named templates and frames for consistent product branding
- PNG via GD (Imagick optional), plus SVG, WebP, EPS, PDF, and binary
- HTTP responses, Blade embeds, disk storage, and data URIs for Inertia/React
- Wi-Fi, email, SMS, and vCard payloads
Quick start
HTTP image
Center logo
Put your mark in the middle. Error correction is raised to high automatically. By default the logo is ~22% of the QR size, with a rounded background punchout so modules do not show through.
Optional pixel width, or disable the punchout pad:
Keep the logo small enough to scan. scanSafe() rejects logos that cover more than ~28% of the code.
Style + brand in one call
Styled codes support PNG and SVG.
| Option | Values |
|---|---|
module() |
square, dots, rounded |
eye() |
square, circle, pointy |
frame() |
none, badge, card |
gradient() |
start, end, direction: vertical, horizontal, diagonal, inverse_diagonal, radial |
Templates: classic, classic-inverted, dots-circle, dots-square-eyes, dots-pointy, dots-small, dots-large, rounded-soft, rounded-medium, rounded-strong, gradient-ocean, gradient-sunset, gradient-aurora, gradient-forest, gradient-inverse, pointy-brand, circle-eyes-square, badge-brand, card-dots.
scanSafe()
Call it before you ship a branded code. Strict mode (default) throws ScanUnsafeException when a style is likely to fail scanners:
- Foreground / background contrast below 4.5:1 (including gradient ends)
- Quiet zone (margin) under 4 modules
- Logo covering more than 28% of the QR area
- Logo without high error correction
- Dots modules + pointy eyes (weak finder patterns)
Use scanSafe(strict: false) in previews; keep strict mode on in production.
Blade
When logo is set, the Blade component turns on scanSafe() for you.
Inertia / React
Generate on Laravel and pass a data URI:
Save to storage
Wi-Fi, email, SMS, vCard
Everyday methods
| Method | What it does |
|---|---|
logo() |
Center brand mark with optional punchout |
scanSafe() / scanSafeIssues() |
Contrast, quiet zone, logo coverage checks |
template() / frame() |
Brand presets and print frames |
module() / eye() / gradient() |
Module shape, finder eyes, fill |
size() / margin() / format() |
Canvas size and output type |
color() / backgroundColor() |
RGB or #hex |
errorCorrection() |
low, medium, quartile, high |
label() |
Caption on unstyled (Endroid) output |
png() / svg() / response() |
HTTP image |
dataUri() / generate() |
Embed or get raw bytes |
store() / disk() |
Save to Laravel storage |
wifi() / email() / sms() / vcard() |
Structured payloads |
generate() returns a QrCodeResult with getString(), getMimeType(), getDataUri(), and saveToFile().
Config
Published file: config/qr-code.php
Defaults you can set: format, size, margin, error correction, colors, and storage disk.
Requirements
- PHP 8.2+
- Laravel 10, 11, or 12
- GD extension for PNG / WebP
Help: enable PHP GD
PNG and WebP need the GD PHP extension. Composer cannot install it for you.
Check:
If nothing shows, enable it:
Ubuntu / Debian
Windows
In php.ini, uncomment:
Restart Apache, Nginx+PHP-FPM, or php artisan serve.
Laravel Sail / Docker
Install gd in the image (Sail usually includes it). Rebuild if needed:
Then confirm again with php -m | grep -i gd.
SVG output can still work without GD. Styled PNG uses GD when Imagick is not installed.
Testing
CI runs PHP 8.2–8.4 × Laravel 10–12.
Issues
Hit a bug, a scan that fails, or an API that is unclear? Open an issue on GitHub with what you tried and what you expected. Feature requests are welcome there too.
Contributing
See CONTRIBUTING.md.
Credits
This package uses:
- bacon/bacon-qr-code (BSD-2-Clause)
- endroid/qr-code (MIT)
Their license notices ship with Composer under vendor/. Full texts: Bacon LICENSE, Endroid LICENSE.
License
The MIT License (MIT). See LICENSE.
All versions of laravel-qr-code with dependencies
bacon/bacon-qr-code Version ^3.0
endroid/qr-code Version ^5.1
illuminate/contracts Version ^10.0|^11.0|^12.0
illuminate/filesystem Version ^10.0|^11.0|^12.0
illuminate/http Version ^10.0|^11.0|^12.0
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/view Version ^10.0|^11.0|^12.0