PHPackages                             yoosuf/qr - 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. [CLI &amp; Console](/categories/cli)
4. /
5. yoosuf/qr

ActiveLibrary[CLI &amp; Console](/categories/cli)

yoosuf/qr
=========

Fast and extensible Laravel QR code generation with typed payload builders, CLI automation, and performance-focused rendering.

1.0.0(1mo ago)10MITPHPPHP ^8.1

Since Jul 16Pushed 1mo agoCompare

[ Source](https://github.com/yoosuf/qr)[ Packagist](https://packagist.org/packages/yoosuf/qr)[ RSS](/packages/yoosuf-qr/feed)WikiDiscussions main Synced 1w ago

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

yoosuf/qr
=========

[](#yoosufqr)

Fast, extensible QR code generation for Laravel apps and automation workflows.

Generate standards-compliant QR payloads, style them for brand needs, and produce output through PHP APIs or CLI with a performance-oriented architecture.

Why this package
----------------

[](#why-this-package)

- Laravel-native integration with auto-discovery, facade, and helper.
- Pluggable style architecture for presets, custom modules, custom eyes, and custom drivers.
- Typed payload builders for URL, Wi-Fi, vCard, MECARD, email, SMS, geo, calendar event, WhatsApp, bitcoin, and raw text.
- Bacon-backed rendering with SVG, PNG, and EPS output options.
- Option merging that keeps defaults, profiles, driver config, and runtime overrides separate.
- Hot-path performance improvements through in-memory writer reuse and optional result caching.

Installation
------------

[](#installation)

```
composer require yoosuf/qr
```

Publish the configuration if needed.

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

Documentation
-------------

[](#documentation)

- CLI usage guide: [docs/CLI.md](docs/CLI.md)
- Architecture guide: [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)
- Product report (topics and descriptions): [docs/REPORT.md](docs/REPORT.md)

Best Fit Use Cases
------------------

[](#best-fit-use-cases)

- checkout and payment QR generation
- event ticket and check-in flows
- contact card and profile sharing
- Wi-Fi onboarding for venues and offices
- batch QR rendering in queues and CI pipelines

Quick Start
-----------

[](#quick-start)

```
use Yoosuf\Qr\Facades\Qr;

$svg = Qr::render('SO-1001')->contents;

$dataUri = Qr::dataUri('SO-1001', 'svg', [
    'profile' => 'brand',
]);

$storedPath = Qr::save('qr/so-1001.svg', 'SO-1001');
```

Typed payloads (all common QR content standards)
------------------------------------------------

[](#typed-payloads-all-common-qr-content-standards)

Pass raw strings, payload arrays, or `QrPayload` objects.

```
use Yoosuf\Qr\Facades\Qr;
use Yoosuf\Qr\Support\QrPayload;

$wifi = QrPayload::wifi('Office-5G', 'super-secret-password', 'WPA2', false);
$vcard = QrPayload::vcard([
    'first_name' => 'Yoosuf',
    'last_name' => 'A',
    'organization' => 'Nord',
    'title' => 'Engineer',
    'phone' => '+9607000000',
    'email' => 'yoosuf@example.com',
    'url' => 'https://example.com',
]);

$svgWifi = Qr::render($wifi)->contents;
$svgContact = Qr::render($vcard)->contents;

// Array payload syntax also works
$sms = Qr::render([
    'type' => 'sms',
    'number' => '+9607000000',
    'message' => 'Hello from QR',
]);
```

Supported payload `type` values:

- `raw`, `text`, `string`
- `url`, `link`
- `phone`, `tel`
- `sms`
- `email`, `mailto`
- `geo`, `location`
- `wifi`
- `vcard`
- `mecard`
- `event`, `vevent`
- `whatsapp`, `wa`
- `bitcoin`, `btc`

Add your own payload type without touching package internals:

```
qr()->extendPayload('upi', function (array $payload): string {
    $vpa = $payload['vpa'] ?? '';
    $name = $payload['name'] ?? '';

    return 'upi://pay?pa='.rawurlencode((string) $vpa).'&pn='.rawurlencode((string) $name);
});
```

Extending the design system
---------------------------

[](#extending-the-design-system)

The package is built around two extension points:

- custom QR modules, such as rounded or branded module groups;
- custom QR eyes, such as circles, points, or fully bespoke finder patterns.

Register custom shapes through the manager and continue using the same rendering API.

```
qr()->extendModule('hex', function (string $name, array $options) {
    return \BaconQrCode\Renderer\Module\SquareModule::instance();
});
```

Output formats
--------------

[](#output-formats)

- `svg` for portable vector output.
- `png` when the `imagick` extension is available.
- `eps` for print-oriented workflows.

CLI generation
--------------

[](#cli-generation)

For full command reference and examples, see [docs/CLI.md](docs/CLI.md).

Generate QR codes directly from Artisan:

```
php artisan qr:generate "SO-1001" --driver=svg --path=qr/so-1001.svg
```

When using the default `local` disk, `--path` is relative to the disk root (`storage/app`). Passing `storage/app/...` is also accepted and normalized automatically.

Generate with typed payload JSON:

```
php artisan qr:generate --payload='{"type":"wifi","ssid":"Office-5G","password":"secret","encryption":"WPA2"}' --driver=svg --path=qr/wifi.svg
```

Print output to terminal (SVG text by default):

```
php artisan qr:generate "https://example.com" --driver=svg
```

Print as data URI:

```
php artisan qr:generate "https://example.com" --data-uri
```

Pass rendering options from CLI (`--option` can be repeated and supports nested keys):

```
php artisan qr:generate "SO-1001" \
    --driver=svg \
    --path=qr/so-1001-brand.svg \
    --option=profile=brand \
    --option=size=512 \
    --option=foreground_gradient.type=diagonal \
    --option=foreground_gradient.start_color=#0f172a \
    --option=foreground_gradient.end_color=#0ea5e9
```

Performance tuning
------------------

[](#performance-tuning)

Enable package-level result caching for repeated payloads and options:

```
// config/qr.php
'cache' => [
    'enabled' => true,
    'store' => 'redis',
    'ttl' => 3600,
    'prefix' => 'qr',
],
```

What is optimized:

- renderer/writer instances are reused in-memory for equivalent style options;
- error correction objects are reused in-memory;
- merged options are memoized in the manager;
- final rendered bytes can be cached through Laravel cache stores.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance90

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

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

45d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/64164?v=4)[Yoosuf Mo](/maintainers/yoosuf)[@yoosuf](https://github.com/yoosuf)

---

Top Contributors

[![yoosuf](https://avatars.githubusercontent.com/u/64164?v=4)](https://github.com/yoosuf "yoosuf (3 commits)")

---

Tags

automationclilaravelpngqrqr-codesvgvcardwifiqr codeqrclilaravelautomationsvgbarcodepngpaymentvCardqr-generatorepswifi

### Embed Badge

![Health badge](/badges/yoosuf-qr/health.svg)

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

###  Alternatives

[linkxtr/laravel-qrcode

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

4033.1k](/packages/linkxtr-laravel-qrcode)[craftcms/cms

Craft CMS

3.6k3.7M3.5k](/packages/craftcms-cms)[laravel/fortify

Backend controllers and scaffolding for Laravel authentication.

1.8k59.4M474](/packages/laravel-fortify)[hasinhayder/tyro-login

Complete authentication kit for Laravel 12 &amp; 13 — 10 premium layouts, social OAuth, passkeys, TOTP 2FA, OTP, magic links, invitations, lockout, captcha and beautiful emails

2539.7k8](/packages/hasinhayder-tyro-login)[psalm/plugin-laravel

Psalm plugin for Laravel

3365.5M359](/packages/psalm-plugin-laravel)[akira/laravel-qrcode

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

499.8k](/packages/akira-laravel-qrcode)

PHPackages © 2026

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