Contoh membuat barcode di laravel dengan menggunakan package milon/barcode

Pertama install dulu package milon/barcode

Begin by installing this package through Composer. Just run following command to terminal-

composer require milon/barcode
 
You can also edit your project's composer.json file to require milon/barcode.
"require": {
    ...
    "milon/barcode": "^7.0"
}
 
For Laravel 6.* use this-
"require": {
    ...
    "milon/barcode": "^6.0"
}
 
For Laravel 5.0 and 5.1 use this-
"require": {
    ...
    "milon/barcode": "^5.1"
}
 
For Laravel 4.0, 4.1 and 4.2 use this-
"require": {
    ...
    "milon/barcode": "^4.2"
}

Kemudian update Composer

composer update
Buka config/app.php, dan tambah seperti dibawah ini :


'providers' => [
    ...
    Milon\Barcode\BarcodeServiceProvider::class,
    ...
]

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

Untuk Sample Nya :


<img src="data:image/png;base64,{{\DNS2D::getBarcodePNG($dt->nisn, 'QRCODE')}}" alt="barcode" style="width: 80px;" />

Belum ada Komentar untuk "Contoh membuat barcode di laravel dengan menggunakan package milon/barcode"

Posting Komentar

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel