PHPackages                             abduns/qrcode - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. abduns/qrcode

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

abduns/qrcode
=============

A from-scratch, framework-agnostic QR Code generator for PHP 8.2+ with zero required runtime dependencies.

v1.1.3(3w ago)0155↓75%1MITPHPPHP ^8.2CI passing

Since May 10Pushed 3w agoCompare

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

READMEChangelogDependencies (3)Versions (9)Used By (1)

qrcode
======

[](#qrcode)

A from-scratch, framework-agnostic QR Code generator for PHP 8.2+ with zero required runtime dependencies.

[![Tests](https://github.com/abduns/qrcode/actions/workflows/ci.yml/badge.svg)](https://github.com/abduns/qrcode/actions/workflows/ci.yml)[![Version](https://camo.githubusercontent.com/5317811df1aa8ca61cebe7680b031a710cdadea2c753cd55a5459e9cd2145cc6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616264756e732f7172636f64652e737667)](https://packagist.org/packages/abduns/qrcode)[![Downloads](https://camo.githubusercontent.com/eb89a91c2493f7266e0f9fd5f11ddc9547b2d2b0e2261f21f1913faab67fefe5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616264756e732f7172636f64652e737667)](https://packagist.org/packages/abduns/qrcode)[![License](https://camo.githubusercontent.com/5458b2e000ca17e7d4170deecf2a0b3df0650c69a928fddaf178a4ed5842f391/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f616264756e732f7172636f64652e737667)](LICENSE.md)

---

Features
--------

[](#features)

- Modern PHP support
- Lightweight and fast
- Typed API
- Framework agnostic
- Standards-oriented
- Extensible architecture
- Zero runtime dependencies
- Three renderers (SVG, PNG, Console)
- ISO/IEC 18004 compliant
- Payload helpers (URL, vCard, Event, etc.)

---

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

[](#installation)

```
composer require abduns/qrcode
```

---

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

[](#quick-start)

```
use Dunn\QrCode\QrCode;
use Dunn\QrCode\EccLevel;
use Dunn\QrCode\Renderer\Svg\SvgRenderer;

$qr = QrCode::create('https://example.com')
    ->errorCorrection(EccLevel::Quartile)
    ->build();

$svg = (new SvgRenderer(size: 300, margin: 4))->render($qr);
file_put_contents('qr.svg', $svg);
```

---

Why This Package?
-----------------

[](#why-this-package)

- Existing solutions are outdated
- Missing modern PHP features
- Poor developer experience
- No standards compliance
- Too framework-coupled

This package focuses on simplicity, interoperability, and modern developer ergonomics.

---

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

```
use Dunn\QrCode\QrCode;

// Payload helpers
QrCode::url('https://example.com')->build();
QrCode::text('hello')->build();
QrCode::phone('+14155550123')->build();
QrCode::sms('+14155550123', body: 'hi')->build();
QrCode::email('a@b.com', subject: 'hello', body: 'hi')->build();
QrCode::geo(37.7749, -122.4194, label: 'SF')->build();
```

### Advanced Usage

[](#advanced-usage)

```
use Dunn\QrCode\Renderer\Svg\SvgRenderer;
use Dunn\QrCode\Style\Color;
use Dunn\QrCode\Style\Logo;
use Dunn\QrCode\Style\ModuleShape\DotModule;
use Dunn\QrCode\Style\EyeStyle\CircleEyeOuter;
use Dunn\QrCode\Style\EyeStyle\SquareEyeInner;

$renderer = new SvgRenderer(
    size: 360,
    margin: 4,
    background: Color::hex('#fafafa'),

    // Data dots: round, dark navy.
    moduleShape: new DotModule(),
    dotColor: Color::hex('#264653'),

    // Marker outer ring: round, teal.
    eyeOuter: new CircleEyeOuter(),
    markerOuterColor: Color::hex('#2a9d8f'),

    // Marker inner pupil: square, terracotta.
    eyeInner: new SquareEyeInner(),
    markerInnerColor: Color::hex('#e76f51'),

    // Optional center logo
    logo: Logo::fromFile(__DIR__ . '/logo.png', sizeRatio: 0.18),
);

$svg = $renderer->render($qr);
```

### Configuration

[](#configuration)

All renderers are highly configurable directly via their constructors.

```
use Dunn\QrCode\Renderer\Png\GdPngRenderer;
use Dunn\QrCode\Renderer\Console\ConsoleRenderer;

$png = (new GdPngRenderer(size: 300))->render($qr);
echo (new ConsoleRenderer(margin: 2))->render($qr);
```

---

Standards / Specifications
--------------------------

[](#standards--specifications)

- ISO/IEC 18004
- RFC 3966 (tel)
- RFC 6068 (mailto)
- RFC 5870 (geo)

References:

-

---

Supported Features
------------------

[](#supported-features)

FeatureSupportSVG Renderer✅PNG Renderer✅Console Renderer✅Custom Colors &amp; Gradients✅Custom Logos✅---

Compatibility
-------------

[](#compatibility)

PlatformSupportedPHP 8.2+✅Laravel✅ (via laravel-qrcode)---

Design Goals
------------

[](#design-goals)

- Developer experience first
- Predictable APIs
- Minimal dependencies
- Strong typing
- Extensibility
- Interoperability
- Byte-exact ISO/IEC 18004 compliance

---

Architecture
------------

[](#architecture)

- immutable objects
- independent encoding logic
- rendering adapters

---

Performance
-----------

[](#performance)

OperationTimeParse &amp; Encode2msSerialize SVG1ms---

Testing
-------

[](#testing)

```
composer test
```

---

Roadmap
-------

[](#roadmap)

- Kanji mode
- Micro QR
- Structured Append

---

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

[](#contributing)

Contributions, issues, and discussions are welcome.

---

Security
--------

[](#security)

If you discover security issues, please report them responsibly.

---

License
-------

[](#license)

MIT

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance95

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

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

Every ~1 days

Total

8

Last Release

23d ago

Major Versions

v0.3.0 → v1.0.02026-05-10

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/28977075?v=4)[Abdun](/maintainers/abduns)[@abduns](https://github.com/abduns)

---

Top Contributors

[![abduns](https://avatars.githubusercontent.com/u/28977075?v=4)](https://github.com/abduns "abduns (20 commits)")

---

Tags

qr codeqrcodeqrsvgbarcodepngiso-18004

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/abduns-qrcode/health.svg)

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

###  Alternatives

[chillerlan/php-qrcode

A QR Code generator and reader with a user-friendly API. PHP 8.4+

2.4k33.8M261](/packages/chillerlan-php-qrcode)[amirezaeb/heroqr

A Powerful QR Code Management Library For PHP

9812.8k](/packages/amirezaeb-heroqr)[jucksearm/php-barcode

Barcode Generation Package inspired by Nicola Asuni.

12381.0k1](/packages/jucksearm-php-barcode)[marcelorodrigo/filament-barcode-scanner-field

A camera-based barcode and QR code scanner input field for Filament forms. Features a modal interface with real-time scanning.

125.7k](/packages/marcelorodrigo-filament-barcode-scanner-field)

PHPackages © 2026

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