yaroslawww / laravel-thinkqr
This package is abandoned and no longer maintained.
The author suggests using the think.studio/laravel-thinkqr package instead.
Wrapper for qrcode functionality.
1.1.0
2023-09-04 18:18 UTC
Requires
- php: ^8.1
- bacon/bacon-qr-code: ^2.0
- illuminate/support: ^9.0|^10.0
- intervention/image: ^2.7
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.25
- orchestra/testbench: ^8.10
- phpunit/phpunit: ^10.3
- psalm/plugin-laravel: ^2.8
- vimeo/psalm: ^5.12
README
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);