PHP code example of yeejiawei / laravel-qrcode

1. Go to this page and download the library: Download yeejiawei/laravel-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/ */

    

yeejiawei / laravel-qrcode example snippets


use \Yeejiawei\LaravelQrcode\LaravelQrcode;

$qr = LaravelQrcode::create('test');

$qr->setErrorCorrectionLevel(ErrorCorrectionLevel::QR_ECLEVEL_M); // default is ErrorCorrectionLevel::QR_ECLEVEL_M

$qr->setSize(100); // Set size of the qr code

$qr->setMargin(4); // Set margin of the qr code

$qr->save(storage_path('app/qr.png'));