Barcode
Barcode stats
- Downloads
- 6M
- Stars
- 1,198
- Open Issues
- 48
- Forks
- 308
Barcode generator like Qr Code, PDF417, C39, C39+, C39E, C39E+, C93, S25, S25+, I25, I25+, C128, C128A, C128B, C128C, 2-Digits UPC-Based Extention, 5-Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI (Variation of Plessey code)
Laravel Barcode Package by Milon
Laravel Barcode is a comprehensive barcode generation package for Laravel, acting as a wrapper around the robust features provided by TCPDF. It simplifies the process of generating various types of barcodes within Laravel applications.
Key Features:
- Supports a wide array of barcode formats including:
- 1D Barcodes: C39, C93, EAN, UPC, and more.
- 2D Barcodes: QR Code, PDF417, DataMatrix.
- Output formats include SVG, HTML, and PNG.
- Compatible with multiple Laravel versions (4.x to 10.x).
- Requires the
php-gdextension.
Installation:
-
Install via Composer:
composer require milon/barcode -
Register the Service Provider:
- For Laravel 5.x and above:
'providers' => [Milon\Barcode\BarcodeServiceProvider::class,]
- For Laravel 4.x:
'providers' => array('Milon\Barcode\BarcodeServiceProvider',)
- For Laravel 5.x and above:
-
Add Aliases:
'aliases' => ['DNS1D' => Milon\Barcode\Facades\DNS1DFacade::class,'DNS2D' => Milon\Barcode\Facades\DNS2DFacade::class,] -
Publish Configuration:
- Laravel 5.x:
php artisan vendor:publish
- Laravel 4.x:
php artisan config:publish milon/barcode
- Laravel 5.x:
Usage Examples:
-
Generate SVG Barcode:
echo DNS1D::getBarcodeSVG('4445645656', 'C39'); -
Generate HTML Barcode:
echo DNS1D::getBarcodeHTML('4445645656', 'C39'); -
Generate PNG Barcode:
echo '<img src="data:image/png;base64,' . DNS1D::getBarcodePNG('4', 'C39+') . '" alt="barcode" />';
Additional Usage:
This package can be utilized outside Laravel by instantiating the barcode classes directly in any PHP script.
Conclusion:
Laravel Barcode is a versatile tool for any developer needing to implement barcode generation within their Laravel applications or even in plain PHP scripts. It provides a vast range of barcode types and formats, making it an essential package for e-commerce systems, inventory management, and more.