PHPackages                             endroid/qrcode-bundle - 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. [Templating &amp; Views](/categories/templating)
4. /
5. endroid/qrcode-bundle

Abandoned → [endroid/qr-code-bundle](/?search=endroid%2Fqr-code-bundle)Symfony-bundle[Templating &amp; Views](/categories/templating)

endroid/qrcode-bundle
=====================

Endroid QR Code Bundle

7.0.1(1mo ago)326263.3k↓76.4%43[1 issues](https://github.com/endroid/qr-code-bundle/issues)[1 PRs](https://github.com/endroid/qr-code-bundle/pulls)1MITPHPPHP ^8.4CI passing

Since Dec 2Pushed 1mo ago4 watchersCompare

[ Source](https://github.com/endroid/qr-code-bundle)[ Packagist](https://packagist.org/packages/endroid/qrcode-bundle)[ Docs](https://github.com/endroid/qr-code-bundle)[ GitHub Sponsors](https://github.com/endroid)[ RSS](/packages/endroid-qrcode-bundle/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependencies (10)Versions (48)Used By (1)

QR Code Bundle
==============

[](#qr-code-bundle)

*By [endroid](https://endroid.nl/)*

[![Latest Stable Version](https://camo.githubusercontent.com/503b6886f5ab603c4edd8a21a4e9000d2aa97f762bb3d60020d69b054eeff52f/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656e64726f69642f71722d636f64652d62756e646c652e737667)](https://packagist.org/packages/endroid/qr-code-bundle)[![Build Status](https://github.com/endroid/qr-code-bundle/workflows/CI/badge.svg)](https://github.com/endroid/qr-code-bundle/actions)[![Total Downloads](https://camo.githubusercontent.com/b0ea606234dbd79fe55b464b2c2234aaa6ba77cad72571f32bcbabb402720a4d/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656e64726f69642f71722d636f64652d62756e646c652e737667)](https://packagist.org/packages/endroid/qr-code-bundle)[![Monthly Downloads](https://camo.githubusercontent.com/97a0809b18a844472a53972792e7edca34605d5f0f3d924444b6c01571cf31b5/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f656e64726f69642f71722d636f64652d62756e646c652e737667)](https://packagist.org/packages/endroid/qr-code-bundle)[![License](https://camo.githubusercontent.com/e7969ef2252da722607be667b99f2e092cb8a5552245d3cd5091074436129122/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f656e64726f69642f71722d636f64652d62756e646c652e737667)](https://packagist.org/packages/endroid/qr-code-bundle)

This Symfony bundle lets you generate QR Codes using the [endroid/qr-code](https://github.com/endroid/qr-code)library. It provides the following features:

- Configure your defaults (like image size, default writer etc.)
- Support for multiple configurations and injection via aliases
- Generate QR codes for defined configurations via URL like /qr-code//Hello
- Generate QR codes or URLs directly from Twig using dedicated functions

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

[](#installation)

Use [Composer](https://getcomposer.org/) to install the library. Also make sure you have enabled and configured the [GD extension](https://www.php.net/manual/en/book.image.php) if you want to generate images.

```
composer require endroid/qr-code-bundle
```

### Route Configuration

[](#route-configuration)

By default the bundle registers a controller that generates QR codes via the URL `/qr-code/{builder}/{data}`. If you only use QR codes programmatically or via Twig and don't need the route, you can disable it. You can also set a custom prefix.

```
endroid_qr_code:
    route_enabled: true
    route_prefix: '/my-custom-prefix'
```

This makes the route available at `/my-custom-prefix/{builder}/{data}`.

Builder Configuration
---------------------

[](#builder-configuration)

The bundle makes use of builders to create QR codes. The default parameters applied by the builder can optionally be overridden via the configuration. And multiple configurations (thus builders) can be defined.

Each entry under `builders` defines a named builder with its own defaults. When no builders are configured the bundle registers a single `default` builder.

```
endroid_qr_code:
    builders:
        default:
            writer: Endroid\QrCode\Writer\PngWriter
            data: 'This is customized QR code'
            logo_path: '%kernel.project_dir%/vendor/endroid/qr-code/tests/assets/symfony.png'
            logo_resize_to_width: 150
            logo_punchout_background: true # only supported by PngWriter
            label_text: 'This is the label'
            label_font_path: '%kernel.project_dir%/vendor/endroid/qr-code/assets/noto_sans.otf'
            label_font_size: 20
            label_alignment: 'center'
        custom:
            writer: Endroid\QrCode\Writer\SvgWriter
            writer_options:
                exclude_xml_declaration: true # default: false
            data: 'This is customized QR code'
            size: 300
            encoding: 'UTF-8'
            error_correction_level: 'low' # 'low', 'medium', 'quartile', or 'high'
            round_block_size_mode: 'margin'
            validate_result: false
```

Using Named Builders
--------------------

[](#using-named-builders)

Each builder is available for injection using its name suffixed with `QrCodeBuilder`. For example the `custom` builder above can be injected as `$customQrCodeBuilder`. You can override the configured defaults at build time:

```
use Endroid\QrCode\Builder\BuilderInterface;

public function __construct(BuilderInterface $customQrCodeBuilder)
{
    $result = $customQrCodeBuilder->build(
        size: 400,
        margin: 20
    );
}
```

QR Code Response
----------------

[](#qr-code-response)

The bundle also provides a response object to ease rendering of the resulting image by automatically saving to contents and setting the correct content type.

```
use Endroid\QrCodeBundle\Response\QrCodeResponse;

$response = new QrCodeResponse($result);
```

Twig Extension
--------------

[](#twig-extension)

The bundle provides a Twig extension for generating a QR code URL, path or data URI. You can use the second argument to specify the builder to use.

```

{# You can specify the builder via the second parameter #}

{# You can access the width and height via the matrix #}
{% set qrCode = qr_code_result('My QR Code') %}

```

Please note that some Twig functions need the route to be enabled to function.

Versioning
----------

[](#versioning)

Version numbers follow the MAJOR.MINOR.PATCH scheme. Backwards compatibility breaking changes will be kept to a minimum but be aware that these can occur. Lock your dependencies for production and test your code when upgrading.

License
-------

[](#license)

This source code is subject to the MIT license bundled in the file LICENSE.

###  Health Score

70

—

ExcellentBetter than 100% of packages

Maintenance93

Actively maintained with recent releases

Popularity50

Moderate usage in the ecosystem

Community26

Small or concentrated contributor base

Maturity93

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 89.3% 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 ~67 days

Recently: every ~163 days

Total

47

Last Release

43d ago

Major Versions

3.x-dev → 4.0.02021-02-28

4.3.3 → 5.0.02023-10-02

5.0.2 → 6.0.02024-10-21

6.1.0 → 7.0.02026-04-22

PHP version history (8 changes)3.0.0PHP &gt;=7.1

3.4.0PHP &gt;=7.2

3.x-devPHP ^7.3||^8.0

4.0.6PHP ^7.4||^8.0

4.2.0PHP ^8.0

4.3.2PHP ^8.1

6.0.0PHP ^8.2

6.1.0PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/ea3fc1b297f29579f9861b5fbe3240c0eeafaaaee6e39b45d85d612a04a52fbd?d=identicon)[endroid](/maintainers/endroid)

---

Top Contributors

[![endroid](https://avatars.githubusercontent.com/u/537253?v=4)](https://github.com/endroid "endroid (158 commits)")[![ThomasLandauer](https://avatars.githubusercontent.com/u/1054469?v=4)](https://github.com/ThomasLandauer "ThomasLandauer (5 commits)")[![qdequippe](https://avatars.githubusercontent.com/u/3193300?v=4)](https://github.com/qdequippe "qdequippe (3 commits)")[![epitre](https://avatars.githubusercontent.com/u/1972431?v=4)](https://github.com/epitre "epitre (3 commits)")[![calvera](https://avatars.githubusercontent.com/u/432090?v=4)](https://github.com/calvera "calvera (1 commits)")[![PhilETaylor](https://avatars.githubusercontent.com/u/400092?v=4)](https://github.com/PhilETaylor "PhilETaylor (1 commits)")[![Saracevas](https://avatars.githubusercontent.com/u/9380319?v=4)](https://github.com/Saracevas "Saracevas (1 commits)")[![tacman](https://avatars.githubusercontent.com/u/619585?v=4)](https://github.com/tacman "tacman (1 commits)")[![markwatney2016](https://avatars.githubusercontent.com/u/22563689?v=4)](https://github.com/markwatney2016 "markwatney2016 (1 commits)")[![curry684](https://avatars.githubusercontent.com/u/1455673?v=4)](https://github.com/curry684 "curry684 (1 commits)")[![javiereguiluz](https://avatars.githubusercontent.com/u/73419?v=4)](https://github.com/javiereguiluz "javiereguiluz (1 commits)")[![maks-rafalko](https://avatars.githubusercontent.com/u/3725595?v=4)](https://github.com/maks-rafalko "maks-rafalko (1 commits)")

---

Tags

bundlecodeendroidfactoryflexqrqrcodesymfonytwigphpqrsymfonybundlecodeendroid

### Embed Badge

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

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

###  Alternatives

[endroid/qr-code-bundle

Endroid QR Code Bundle

32511.4M25](/packages/endroid-qr-code-bundle)[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1189.8k](/packages/rcsofttech-audit-trail-bundle)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k13](/packages/2lenet-crudit-bundle)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k61](/packages/open-dxp-opendxp)

PHPackages © 2026

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