PHP code example of jeeven / qrcode

1. Go to this page and download the library: Download jeeven/qrcode library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jeeven / qrcode example snippets


use Jeeven\QrCode\Facades\QrCodeGenerator;

$png = QrCodeGenerator::make('https://example.com')->toPng();

$svg = QrCodeGenerator::make('https://example.com')
    ->size(400)
    ->margin(20)
    ->format('svg')
    ->errorCorrection('high')
    ->color('#1a1a1a')
    ->backgroundColor('#ffffff')
    ->toSvg();

$dataUri = QrCodeGenerator::make('order-12345')->toBase64();
// <img src="{{ $dataUri }}">

// routes/web.php
Route::get('/my-qr', function () {
    return QrCodeGenerator::make('https://example.com')->format('png')->toResponse();
});

QrCodeGenerator::make('https://example.com')->format('svg')->save(storage_path('app/qr/mycode.svg'));

QrCodeGenerator::make('https://example.com')
    ->label('Scan me!', fontSize: 18)
    ->toPng();

QrCodeGenerator::make('https://example.com')
    ->logo(public_path('images/logo.png'), size: 60)
    ->toPng();
bash
php artisan vendor:publish --tag=qrcode-config

GET /qrcode/https://example.com?size=300&format=png&color=%23000000