PHPackages                             survos/barcode-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. [Image &amp; Media](/categories/media)
4. /
5. survos/barcode-bundle

ActiveSymfony-bundle[Image &amp; Media](/categories/media)

survos/barcode-bundle
=====================

Integrates picqer/php-barcode-generator in a Symfony application

2.0.117(6mo ago)319.3k↓15.5%MITPHPPHP ^8.4CI failing

Since May 26Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/survos/barcode-bundle)[ Packagist](https://packagist.org/packages/survos/barcode-bundle)[ GitHub Sponsors](https://github.com/kbond)[ RSS](/packages/survos-barcode-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (20)Versions (845)Used By (0)

BarcodeBundle
=============

[](#barcodebundle)

Symfony Bundle for the [picqer/php-barcode-generator](https://github.com/picqer/php-barcode-generator) library, to generate an SVG barcode within twig.

Barcode Bundle Demo
===================

[](#barcode-bundle-demo)

Quick demonstration of survos/barcode-bundle functionality.

Prerequisites
-------------

[](#prerequisites)

- PHP 8.2+
- Symfony CLI
- [Castor](https://castor.jolicode.com/) task runner

Install Castor
--------------

[](#install-castor)

```
curl "https://castor.jolicode.com/install" | bash
```

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

[](#quick-start)

```
# Create a new Symfony project
symfony new barcode-demo --webapp
cd barcode-demo

# Download the demo castor file
wget https://raw.githubusercontent.com/survos/barcode-bundle/main/castor/castor.php

# See available tasks
castor list

# Build complete demo (installs bundle, creates files, sets up database, starts server)
castor build
```

Individual Steps
----------------

[](#individual-steps)

Run these independently if you prefer:

```
castor setup        # Install bundle and create directories
castor copy-files   # Copy demo files from bundle
castor database     # Configure SQLite and create schema
castor import       # Load sample product data
castor open         # Start web server and open browser
castor clean        # Remove demo files (optional)
```

What Gets Created
-----------------

[](#what-gets-created)

- `src/Entity/Product.php` - Sample entity with barcode support
- `src/Repository/ProductRepository.php` - Repository
- `src/Command/ImportProductsCommand.php` - Data import command
- `templates/products.html.twig` - Product listing template
- SQLite database with sample products

Next Steps
----------

[](#next-steps)

Visit the opened browser to see:

- Product listing with barcodes
- EasyAdmin dashboard
- Barcode generation examples

Cleanup
-------

[](#cleanup)

```
castor clean  # Removes all demo files
```

Troubleshothy
-------------

[](#troubleshothy)

**Castor file not found**: Make sure you're in the project root directory

**Permission denied**: Run `chmod +x castor.php`

**Bundle not installed**: Run `castor setup` first before other commands

Demo Application
----------------

[](#demo-application)

Try the bundle instantly:

```
symfony new barcode-demo --webapp && cd barcode-demo && \
wget https://raw.githubusercontent.com/survos/barcode-bundle/main/castor/castor.php && \
castor build
```

See the [demo README](castor/README.md) for step-by-step instructions.

```
composer req survos/barcode-bundle
```

```
{# as a filter #}
{{ '12345'|barcode }}

{# as a function #}
{{ barcode(random(), 2, 80, 'red' }}
```

To set default values (@todo: install recipe)

```
# config/packages/barcode.yaml
barcode:
  widthFactor: 3
  height: 120
  foregroundColor: 'purple'
```

Proof that it works
-------------------

[](#proof-that-it-works)

Requirements:

- Locally installed PHP 8, with GD or Imagick
- Symfony CLI
- sed (to change /app to / without opening an editor)

```
symfony new BarcodeDemo --webapp && cd BarcodeDemo
symfony composer req survos/barcode-bundle
symfony console make:controller AppController
sed -i "s|/app|/|" src/Controller/AppController.php

cat  templates/app/index.html.twig
{% extends 'base.html.twig' %}
{% block body %}
{{ 'test'|barcode }} or {{ barcode('test', 2, 80, 'red') }}
{% endblock %}
EOF

#echo "{{ 'test'|barcode }} or {{ barcode('test', 2, 80, 'red') }} " >> templates/app/index.html.twig
symfony server:start -d
symfony open:local
```

###  Health Score

56

—

FairBetter than 98% of packages

Maintenance80

Actively maintained with recent releases

Popularity30

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity85

Battle-tested with a long release history

 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 ~2 days

Total

843

Last Release

196d ago

Major Versions

1.6.34 → 2.0.182025-09-28

PHP version history (4 changes)1.0.1PHP ^8.1

1.5.387PHP ^8.2

1.5.403PHP ^8.3

2.0.18PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/21b39551f92ed4143772c622f9e571589c5a72c96ab3c53fe67489ce0d83e806?d=identicon)[tacman1123](/maintainers/tacman1123)

---

Top Contributors

[![tacman](https://avatars.githubusercontent.com/u/619585?v=4)](https://github.com/tacman "tacman (24 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/survos-barcode-bundle/health.svg)

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

###  Alternatives

[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[sonata-project/entity-audit-bundle

Audit for Doctrine Entities

644989.8k1](/packages/sonata-project-entity-audit-bundle)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[spomky-labs/pwa-bundle

Progressive Web App Manifest Generator Bundle for Symfony.

6144.4k1](/packages/spomky-labs-pwa-bundle)[open-dxp/opendxp

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

7310.3k29](/packages/open-dxp-opendxp)

PHPackages © 2026

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