how to Generate Barcode in laravel 8

in this blogpost, I wil give generate barcode in laravel php, hello and you use this code step by step follow by as my handled and get the output as run done.

picqer/php-barcode-generator is a composer package for generate barcode.

Here i will use and admin panel show code and listing view this.

how to generate barcode in laravel, Barcode Generator in laravel

Step 1: Install Laravel Project how to generate barcode in laravel

in this first step i will use only this command and create new project.

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

Step 2: Install picqer/php-barcode-generator Package

Now we are run this command:

composer require picqer/php-barcode-generator

Step 3: Create Route : how to Generate Barcode in laravel



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

Step 4: Create Blade file


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

Now run your project…

1 thought on “how to Generate Barcode in laravel 8”

Leave a Comment