laravel 9

How To Generate Barcode In Laravel 9

Pinterest LinkedIn Tumblr

Step 1: Create the application

We need to run command to create Laravel 9 projects.

composer create-project --prefer-dist laravel/laravel laravel-8-barcode-generator

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

composer require picqer/php-barcode-generator

Step 3: Create Route

Now I am going to create route for calling controller and function.



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

Step 4: Create Blade file


<!DOCTYPE html>
      <title>Barcode Generator In Laravel 9 </title>
      <!-- CSS only -->
      <link rel="stylesheet" href="">
      <!-- Js only -->
      <div class="container">
         <div class="jumbotron">
            <div class="container text-center">
                  Barcode Generator In Laravel 9

         <div class="container text-center d-flex align-items-center justify-content-center">
            <h3>Product 2: MAC-1200</h3>
                $generatorPNG = new Picqer\Barcode\BarcodeGeneratorPNG();
            <img src="data:image/png;base64,{{ base64_encode($generatorPNG->getBarcode('MAC-1200', $generatorPNG::TYPE_CODE_128)) }}">

Run Project

php artisan serve

Write A Comment