PHPackages                             tumutech/laravel-qr-code - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. tumutech/laravel-qr-code

ActiveLibrary

tumutech/laravel-qr-code
========================

QR code generation for Laravel — PNG, SVG, Blade, storage, and branded styles

v1.0.0(today)01↑2900%MITPHPPHP ^8.2CI passing

Since Aug 14Pushed todayCompare

[ Source](https://github.com/tumutech/laravel-qr-code)[ Packagist](https://packagist.org/packages/tumutech/laravel-qr-code)[ RSS](/packages/tumutech-laravel-qr-code/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (11)Versions (2)Used By (0)

Laravel QR Code
===============

[](#laravel-qr-code)

Branded, scannable QR codes inside Laravel — center logos, style templates, scan-safe checks, HTTP responses, Blade, storage, and data URIs for Inertia.

```
composer require tumutech/laravel-qr-code
```

Laravel auto-discovers the package. No extra setup.

Optional defaults:

```
php artisan vendor:publish --tag=qr-code-config
```

What it offers
--------------

[](#what-it-offers)

- **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
- HTTP responses, Blade embeds, disk storage, and data URIs for Inertia/React
- PNG, SVG, WebP, EPS, PDF, and raw binary
- Wi-Fi, email, SMS, and vCard payloads

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 10, 11, or 12
- GD extension for PNG / WebP

Usage
-----

[](#usage)

```
use Tumutech\QrCode\Facades\QrCode;

return QrCode::size(300)->png('https://example.com');
```

### Center logo

[](#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 behind it.

```
return QrCode::size(400)
    ->logo(public_path('images/brand.png'))
    ->scanSafe()
    ->png('https://example.com/invite');
```

Optional pixel width, or disable the punchout pad:

```
QrCode::logo(public_path('images/brand.png'), 88);          // custom width
QrCode::logo(public_path('images/brand.png'), null, false); // no punchout
```

Keep the logo small enough to scan. `scanSafe()` rejects logos that cover too much of the code.

### Style + brand in one call

[](#style--brand-in-one-call)

```
QrCode::template('gradient-ocean')
    ->logo(public_path('images/brand.png'))
    ->scanSafe()
    ->png('https://example.com');

QrCode::module('dots', 0.8)
    ->eye('circle')
    ->color('#101824')
    ->backgroundColor('#ffffff')
    ->logo(public_path('images/brand.png'))
    ->scanSafe()
    ->png('https://example.com');
```

Styled codes support **PNG** and **SVG**.

OptionValues`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`.

### Embed in Blade

[](#embed-in-blade)

```

```

When `logo` is set, the Blade component turns on `scanSafe()` for you.

### Inertia / React

[](#inertia--react)

Generate on Laravel and pass a data URI:

```
return Inertia::render('Ticket', [
    'qr' => QrCode::size(240)
        ->logo(public_path('images/brand.png'))
        ->scanSafe()
        ->dataUri($ticketUrl),
]);
```

```

```

### Save to storage

[](#save-to-storage)

```
QrCode::logo(public_path('images/brand.png'))
    ->scanSafe()
    ->store('https://example.com', 'qrs/ticket.png');

QrCode::disk('s3')->store('https://example.com', 'qrs/ticket.png');
```

### Wi-Fi, email, SMS, vCard

[](#wi-fi-email-sms-vcard)

```
$qr = QrCode::wifi([
    'ssid' => 'Office',
    'password' => 'secret',
]);

echo $qr->getDataUri();

QrCode::email('hello@example.com', 'Subject', 'Body');
QrCode::sms('+15551234567', 'Hello');
QrCode::vcard([
    'firstName' => 'Ada',
    'lastName' => 'Lovelace',
    'organization' => 'Example',
    'phones' => ['+15551234567'],
    'emails' => ['ada@example.com'],
]);
```

Everyday methods
----------------

[](#everyday-methods)

MethodWhat it does`logo()`Center brand mark with optional punchout`scanSafe()`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``png()` / `svg()` / `response()`HTTP image`dataUri()` / `generate()`Embed or get raw bytes`store()` / `disk()`Save to Laravel storage`wifi()` / `email()` / `sms()` / `vcard()`Structured payloadsConfig
------

[](#config)

Published file: `config/qr-code.php`

Defaults you can set: format, size, margin, error correction, colors, and storage disk.

Help: enable PHP GD
-------------------

[](#help-enable-php-gd)

PNG and WebP need the **GD** PHP extension. Composer cannot install it for you.

Check:

```
php -m | grep -i gd
```

If nothing shows, enable it:

**Ubuntu / Debian**

```
sudo apt install php-gd
sudo systemctl restart php8.2-fpm   # or your PHP-FPM / Apache service
```

**Windows**

In `php.ini`, uncomment:

```
extension=gd
```

Restart Apache, Nginx+PHP-FPM, or `php artisan serve`.

**Laravel Sail / Docker**

Install `gd` in the image (Sail usually includes it). Rebuild if needed:

```
sail build --no-cache
```

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.

Credits
-------

[](#credits)

This package uses:

- [bacon/bacon-qr-code](https://github.com/Bacon/BaconQrCode) (BSD-2-Clause)
- [endroid/qr-code](https://github.com/endroid/qr-code) (MIT)

Their license notices ship with Composer under `vendor/`. Full texts: [Bacon LICENSE](https://github.com/Bacon/BaconQrCode/blob/master/LICENSE), [Endroid LICENSE](https://github.com/endroid/qr-code/blob/main/LICENSE).

Contributing
------------

[](#contributing)

See [CONTRIBUTING.md](CONTRIBUTING.md).

License
-------

[](#license)

MIT

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance100

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

0d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/80533694?v=4)[Tumusiime Francis](/maintainers/tumutech)[@tumutech](https://github.com/tumutech)

---

Top Contributors

[![tumutech](https://avatars.githubusercontent.com/u/80533694?v=4)](https://github.com/tumutech "tumutech (2 commits)")

---

Tags

qr codeqrlaravelbarcodevCardwifi

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tumutech-laravel-qr-code/health.svg)

```
[![Health](https://phpackages.com/badges/tumutech-laravel-qr-code/health.svg)](https://phpackages.com/packages/tumutech-laravel-qr-code)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[moonshine/moonshine

Laravel administration panel

1.3k268.2k88](/packages/moonshine-moonshine)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45844.8k1](/packages/pressbooks-pressbooks)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.6k31.8M158](/packages/laravel-cashier)[laravel/ai

The official AI SDK for Laravel.

1.1k4.6M307](/packages/laravel-ai)[linkxtr/laravel-qrcode

A clean, modern, and easy-to-use QR code generator for Laravel

3827.1k](/packages/linkxtr-laravel-qrcode)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
