Looking to hire Laravel developers? Try LaraJobs

laravel-thinkqr maintained by think.studio

Description
Wrapper for qrcode functionality.
Last update
2023/09/04 20:18 (dev-main)
License
Downloads
20
Tags

Comments
comments powered by Disqus

Laravel think kit.

Packagist License Packagist Version Total Downloads Build Status Code Coverage Scrutinizer Code Quality

Wrapper for qrcode functionality.

Installation

Install the package via composer:

composer require think.studio/laravel-thinkqr

Optionally you can publish the config file with:

php artisan vendor:publish --provider="ThinkQR\ServiceProvider" --tag="config"

Usage

$qrCode = \ThinkQR\QRCode::make('foo');
// or
$qrCode = \ThinkQR\QRCode::make('foo', [
    'render_size' => 300,
    'margin' => 10,
]);

$qrCode->getSvgString(); // XML svg string
$qrCode->getPngString(); // Binary png string (you can encode to base64 and use as data image)

// Save Files
$qrCode->writeSvgFile('my/path/file.svg');
$qrCode->writePngFile('my/path/file.png');

Create tmp image for insert to some dynamic script like pdf.

use ThinkQR\Image\QrCodeImageForPdf;

$pdf = new Fpdi();

$pdf->Image(QrCodeImageForPdf::make('https://example.com/foo-bar-baz', [
            'render_size' => 200,
            'margin' => 2,
        ])->filePath(), 0, 0, 30);

Credits

  • Think Studio