We will learn Laravel 8 Barcode Generator Example

Step 1: 

Install Laravel 8 

composer create-project --prefer-dist laravel/laravel blog

Step 2: 

Install picqer/php-barcode-generator Package 

composer require picqer/php-barcode-generator

Step 3: 

Create Route routes/web.php


Route::view('barcode', 'barcode');

Step 4: 

Create Blade file resources/views/barcode.blade.php

<!DOCTYPE html>
    <title>How to Generate Bar Code in Laravel?</title>
<h1>How to Generate Bar Code in Laravel?</h1>
<h3>Product: 0001245259636</h3>
    $generator = new Picqer\Barcode\BarcodeGeneratorHTML();
{!! $generator->getBarcode('0001245259636', $generator::TYPE_CODE_128) !!}
<h3>Product 2: 000005263635</h3>
    $generatorPNG = new Picqer\Barcode\BarcodeGeneratorPNG();
<img src="data:image/png;base64,{{ base64_encode($generatorPNG->getBarcode('000005263635', $generatorPNG::TYPE_CODE_128)) }}">

May this help you.