yoosuf / barcode
Production-ready Laravel barcode package with pluggable drivers, filesystem support, and API-friendly outputs.
Fund package maintenance!
1.0.0
2026-07-16 14:49 UTC
Requires
- php: ^8.1
- bacon/bacon-qr-code: ^3.0
- illuminate/support: ^10.0|^11.0|^12.0
- picqer/php-barcode-generator: ^2.4
README
Production-ready Laravel barcode package with pluggable drivers, filesystem support, and API-friendly outputs.
Why This Package
- Laravel-native integration with auto-discovery, facade, and config publishing.
- Stable manager and driver contract for long-term compatibility.
- Multiple output modes suitable for APIs, Blade views, jobs, and document pipelines.
- Easy custom driver extension without touching package internals.
- Works with modern Laravel versions while preserving simple integration points.
- Supports standard 1D barcode symbologies through Picqer.
Compatibility
- PHP:
^8.1 - Laravel:
^10.0 | ^11.0 | ^12.0
Installation
composer require yoosuf/barcode
Optional: publish configuration.
php artisan vendor:publish --tag=barcode-config
Quick Start
use Yoosuf\Barcode\Facades\Barcode; $svg = Barcode::render('SO-1001')->contents; $dataUri = Barcode::dataUri('SO-1001', 'png', [ 'type' => 'TYPE_CODE_128', 'width' => 2, 'height' => 80, ]); $storedPath = Barcode::save('barcodes/so-1001.svg', 'SO-1001', 'svg');
CLI
Generate a barcode from Artisan and save it to disk:
php artisan barcode:generate SO-1001 --driver=svg --output=storage/app/barcodes/so-1001.svg
You can also print SVG or HTML output directly to the terminal:
php artisan barcode:generate SO-1001 --driver=svg
Core Architecture
BarcodeServiceProvider: package registration, config merge, and publish.BarcodeManager: driver resolution, option merge, rendering, persistence.Contracts\BarcodeDriver: unified contract for all drivers.Drivers\*: built-in engine implementations.Support\BarcodeResult: output payload + metadata.
For complete details, see the architecture guide.
Documentation Index
- Architecture: docs/ARCHITECTURE.md
- API Reference: docs/API.md
- Configuration: docs/CONFIGURATION.md
- Usage Guide: docs/USAGE.md
- Extending Drivers: docs/EXTENDING.md
- Operations: docs/OPERATIONS.md
- Contributing: CONTRIBUTING.md
- Changelog: CHANGELOG.md
GitHub Repository Metadata
Use this description for the GitHub repository:
Production-ready Laravel barcode package with pluggable drivers, filesystem support, and API-friendly outputs.
Recommended GitHub topics:
laravellaravel-packagebarcodephpcode128ean13upccode39code93itf14msisvgpngapifilesystem
Supported Barcode Types
The package exposes the full 1D symbology set supported by Picqer:
TYPE_CODE_32TYPE_CODE_39TYPE_CODE_39_CHECKSUMTYPE_CODE_39ETYPE_CODE_39E_CHECKSUMTYPE_CODE_93TYPE_STANDARD_2_5TYPE_STANDARD_2_5_CHECKSUMTYPE_INTERLEAVED_2_5TYPE_INTERLEAVED_2_5_CHECKSUMTYPE_ITF_14TYPE_CODE_128TYPE_CODE_128_ATYPE_CODE_128_BTYPE_CODE_128_CTYPE_EAN_2TYPE_EAN_5TYPE_EAN_8TYPE_EAN_13TYPE_UPC_ATYPE_UPC_ETYPE_MSITYPE_MSI_CHECKSUMTYPE_POSTNETTYPE_PLANETTYPE_TELEPEN_ALPHATYPE_TELEPEN_NUMERICTYPE_RMS4CCTYPE_KIXTYPE_IMBTYPE_CODABARTYPE_CODE_11TYPE_PHARMA_CODETYPE_PHARMA_CODE_TWO_TRACKS
License
MIT