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

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

chapdel/qr-code
===============

A powerful PHP library for generating styled QR codes

1.0(4mo ago)776MITPHPPHP ^8.2

Since Jan 10Pushed 4mo agoCompare

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

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Chapdel QR Code Styling
=======================

[](#chapdel-qr-code-styling)

A powerful PHP library for generating styled QR codes with support for:

- 🎨 **SVG &amp; Raster** (PNG, JPG, GIF) Output
- 🌈 **Gradients** (Linear &amp; Radial)
- 🔴 **Custom Dot Styles** (Rounded, Classy, Classy-Rounded, Dots, Square)
- 🖼️ **Logo Integration** (Centered images with background clearing)
- 🎭 **Predefined Themes** (Facebook, Organic, Neon, etc.)
- 🔧 **Custom Renderers** (Draw your own shapes via PHP closures)
- ✨ **Animated GIFs** (Create rotating gradient animations)

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

[](#installation)

```
composer require chapdel/qr-code
```

*Note: The `imagick` extension is recommended for high-quality raster output (PNG/JPG/GIF) and custom shapes in raster mode. GD is used as a fallback for basic squares.*

Usage
-----

[](#usage)

### Basic Example

[](#basic-example)

```
use Chapdel\Qr\QRCodeStyling;

$qr = new QRCodeStyling([
    'data' => 'https://example.com',
    'image' => 'https://link-to-your-logo.com/logo.png',
    'dotsOptions' => [
        'type' => 'rounded',
        'color' => '#4267b2'
    ],
    'backgroundOptions' => [
        'color' => '#ffffff',
    ]
]);

// Output SVG
header('Content-Type: image/svg+xml');
echo $qr->getRawData('svg');
```

### Advanced Styling with Gradients

[](#advanced-styling-with-gradients)

```
$qr = new QRCodeStyling([
    'data' => 'https://example.com',
    'dotsOptions' => [
        'type' => 'classy-rounded',
        'gradient' => [
            'type' => 'linear',
            'rotation' => 45,
            'colorStops' => [
                ['offset' => 0, 'color' => '#ff0000'],
                ['offset' => 1, 'color' => '#0000ff']
            ]
        ]
    ],
    'cornersSquareOptions' => [
        'type' => 'extra-rounded',
        'color' => '#000000'
    ]
]);
```

### Using Helpers for Content

[](#using-helpers-for-content)

Easily generate special content like WiFi, vCard, or SMS without knowing the raw syntax.

```
use Chapdel\Qr\Helper\QRContent;

$wifiData = QRContent::wifi('MyHomeNetwork', 'SecretPassword', 'WPA');
// WIFI:T:WPA;S:MyHomeNetwork;P:SecretPassword;;

$qr->update(['data' => $wifiData]);
```

### Applying Themes

[](#applying-themes)

Apply professional styles instantly using predefined themes.

```
$qr->applyTheme('facebook');
// Automatically sets colors, logo, and shapes to match Facebook branding.

$qr->applyTheme('dark-neon');
// Sets a dark background with neon gradients.
```

### Custom Shapes (Advanced)

[](#custom-shapes-advanced)

Define your own dot renderer using a Closure. This allows you to draw any SVG path for the QR modules.

```
$qr->update([
    'dotsOptions' => [
        'type' => 'custom',
        'renderer' => function($x, $y, $size, $color) {
            // Draw a star, heart, or specific icon
            return '';
        }
    ]
]);
```

### Animated GIF

[](#animated-gif)

Generate an animated QR code (requires Imagick).

```
$gifBinary = $qr->getRawData('gif');
file_put_contents('animated_qr.gif', $gifBinary);
```

Supported Options
-----------------

[](#supported-options)

Option CategoryKey Features**`dotsOptions`**Types: `square`, `dots`, `rounded`, `extra-rounded`, `classy`, `classy-rounded`, `custom`. Gradient support.**`cornersSquareOptions`**Types: `square`, `dot`, `extra-rounded`, `none`. Separate colors/gradients.**`cornersDotOptions`**Types: square, dot. Separate colors/gradients.**`backgroundOptions`**Color, Gradient, Rounding (border-radius).**`imageOptions`**`hideBackgroundDots` (clears dots behind logo), `imageSize`, `margin`.**`qrOptions`**`typeNumber` (Version 0-40), `errorCorrectionLevel` (L, M, Q, H).Requirements
------------

[](#requirements)

- PHP 8.2+
- `ext-gd` (Standard fallback)
- `ext-imagick` (Recommended for advanced raster features)

License
-------

[](#license)

MIT

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance77

Regular maintenance activity

Popularity18

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

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

127d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20987014?v=4)[Chapdel KAMGA](/maintainers/chapdel)[@chapdel](https://github.com/chapdel)

---

Top Contributors

[![chapdel](https://avatars.githubusercontent.com/u/20987014?v=4)](https://github.com/chapdel "chapdel (5 commits)")

---

Tags

phpqrcodeqrgeneratorsvglogostylinggradient

###  Code Quality

TestsPest

### Embed Badge

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

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

###  Alternatives

[endroid/qr-code

Endroid QR Code

4.8k67.6M348](/packages/endroid-qr-code)[amirezaeb/heroqr

A Powerful QR Code Management Library For PHP

9510.3k](/packages/amirezaeb-heroqr)[tomloprod/radiance

A deterministic mesh gradient avatar generator for PHP.

1393.7k](/packages/tomloprod-radiance)[arcanedev/qr-code

QR Code generator

1231.9k1](/packages/arcanedev-qr-code)[linkxtr/laravel-qrcode

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

295.1k](/packages/linkxtr-laravel-qrcode)[akira/laravel-qrcode

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

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

PHPackages © 2026

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