Barcode

milon/barcode image

Barcode stats

Downloads
6M
Stars
1,198
Open Issues
48
Forks
308

View on GitHub →

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-gd extension.

Installation:

  1. Install via Composer:

    composer require milon/barcode
  2. Register the Service Provider:

    • For Laravel 5.x and above:
      'providers' => [
      Milon\Barcode\BarcodeServiceProvider::class,
      ]
    • For Laravel 4.x:
      'providers' => array(
      'Milon\Barcode\BarcodeServiceProvider',
      )
  3. Add Aliases:

    'aliases' => [
    'DNS1D' => Milon\Barcode\Facades\DNS1DFacade::class,
    'DNS2D' => Milon\Barcode\Facades\DNS2DFacade::class,
    ]
  4. Publish Configuration:

    • Laravel 5.x:
      php artisan vendor:publish
    • Laravel 4.x:
      php artisan config:publish milon/barcode

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.

milon photo

Programmer, Author, Tech Enthusiast.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.


Milon Barcode Related Articles

Create Apple Wallet Passes in Laravel image

Create Apple Wallet Passes in Laravel

Read article
Laravel Scoped Route Binding for Nested Resource Management image

Laravel Scoped Route Binding for Nested Resource Management

Read article
Direct Printing for Laravel Apps image

Direct Printing for Laravel Apps

Read article
Open Food Facts API image

Open Food Facts API

Read article
Statamic logo

Statamic

The drop-in ready Laravel CMS you’re been waiting for. Go full-stack or headless, flat file or database – it’s up to you.

Statamic
Celebian logo

Celebian

Celebian is a social media marketing agency specializing in helping their clients go viral on TikTok. Whether you're looking to reach a bigger audience or gain more Tiktok followers, likes, and views, they've got you covered.

Celebian
The Certification of Competence for Laravel logo

The Certification of Competence for Laravel

A community-driven, proctored assessment across 4 levels designed to validate real-world Laravel knowledge, from Junior to mastery-level Artisan. Official Vue.js, Official Nuxt, Angular, React, JS certifications also available.

The Certification of Competence for Laravel
Curotec logo

Curotec

World class Laravel experts with GenAI dev skills. LATAM-based, embedded engineers that ship fast, communicate clearly, and elevate your product. No bloat, no BS.

Curotec
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media
No Compromises logo

No Compromises

Joel and Aaron, the two seasoned devs from the No Compromises podcast, are now available to hire for your Laravel project. ⬧ Flat rate of $9500/mo. ⬧ No lengthy sales process. ⬧ No contracts. ⬧ 100% money back guarantee.

No Compromises