Polyscope - The agent-first dev environment for Laravel

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
Tighten logo

Tighten

We help companies turn great ideas into amazing apps, products, and services.

Tighten
Blastup logo

Blastup

Blastup provides social media enhancement services including buying Instagram likes, followers, and views, with features like instant delivery and a variety of packages to suit different needs.

Blastup
Get expert guidance in a few days with a Laravel code review logo

Get expert guidance in a few days with a Laravel code review

Expert code review! Get clear, practical feedback from two Laravel devs with 10+ years of experience helping teams build better apps.

Get expert guidance in a few days with a Laravel code review
Acquaint Softtech logo

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Typesense Search logo

Typesense Search

Typesense is an open source, blazing-fast search engine, optimized for helping you build delightful search experiences for your sites and apps. Natively integrated with Laravel Scout.

Typesense Search