baks-dev/barcode
BaksDev Barcode is a PHP 8.4+ module for generating and reading barcodes, supporting Aztec, Code39/93/128, DataMatrix, EAN-8/13, ITF, PDF417, QR Code, UPC-A and UPC-E. Install via composer require baks-dev/barcode; requires ImageMagick and related extensions.
Consider it when:
php-imagick, libpoppler-glib-dev, librsvg, libcairo, and you can chmod +x three CLI scripts inside vendor/.Look elsewhere when:
vendor/ plus native libs are a poor fit for Lambda, Cloud Run, or immutable images.endroid/qr-code or bacon/bacon-qr-code are pure-PHP, no Imagick, vastly better supported.picqer/php-barcode-generator is the mature, boring choice.Decision rule I'd apply: treat this as a replaceable adapter, not a platform commitment. Define an internal BarcodeService contract, implement it with this package, and keep endroid/qr-code + a decoder as the documented fallback. Swap cost should be under two days.
To executives — the ask is a spike, not a commitment. "We can add barcode generation and reading to our existing PHP stack with an MIT-licensed library — no per-scan fees, no new vendor contract, no procurement cycle. It covers every format our target segments ask for: EAN/UPC for retail, Code128 and PDF417 for shipping docs, QR for customer journeys, DataMatrix for regulated verticals. It runs entirely on our own servers, so no data leaves our infrastructure.
Caveat you should hear from me directly: this library has effectively no external adoption — no dependents, no community, one maintainer, release notes that just repeat the version number. So I'm not proposing we standardize on it. I'm proposing a one-week spike: prove it installs reproducibly in our Docker image and round-trips a real label. If it passes, we ship Phase 1 labels on it behind an internal interface. If it fails, we already have the fallback selected and we've lost a week. I'm not going to quote you a dollar-savings figure — the win here is schedule and avoided procurement, not a hard cost reduction we've measured."
To engineering — here's what you're actually signing up for.
BarcodeGenerator, BarcodeReader, PdfBarcode).imagick, libpoppler, librsvg, libcairo, and execute permission on Writer/Generate, Reader/Decode, Pdf/PdfCropImg. The chmod-inside-vendor step is the biggest operational smell — it breaks on composer install and on read-only filesystems, so it needs automating in the image build or it will bite us monthly.barcode:{type}:{data}, push bulk runs to a queue, and validate decoded payloads before rendering — a QR is untrusted input and a straight path to stored XSS if we concatenate it into a view.To design/product — what this unlocks. Shelf and product labels, shipping and returns documents, and QR entry points for loyalty, manuals, and warranty registration. Design constraint to socialize: every barcode must ship with a human-readable text alternative nearby — it is both an accessibility requirement and a scan-failure recovery path.
How can I help you explore Laravel packages today?