dominik-eller / laravel-qr-code
生成二维码
v1.1.0
2024-09-20 14:40 UTC
Requires
- php: ^8.2
- ext-gd: *
- bacon/bacon-qr-code: ^3.0
- illuminate/contracts: ^10.0||^11.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^2.9
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^9.0.0||^8.22.0
- pestphp/pest: ^2.34
- pestphp/pest-plugin-arch: ^2.7
- pestphp/pest-plugin-laravel: ^2.3
- phpstan/extension-installer: ^1.3
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-phpunit: ^1.3
README
此包允许您生成二维码。
安装
您可以通过composer安装此包
composer require dominik-eller/laravel-qr-code
使用示例:生成URL二维码
您可以使用QrCode外观轻松地为URL生成二维码。以下是如何为https://example.com这样的URL生成二维码的示例
use Deller\QrCode\Facades\QrCode; // Generate a QR code for a URL $qrCode = QrCode::create('url') ->setUrl('https://example.com') ->setSize(300) // Set the size of the QR code ->setColor([0, 0, 0]) // Set the foreground color (black) ->setBackgroundColor([255, 255, 255]) // Set the background color (white) ->setErrorCorrectionLevel('H') // Set error correction level (High) ->generate(); // Now you can return the QR code as a string, or save it to a file, etc.
测试
composer test
变更日志
请参阅CHANGELOG以获取有关最近更改的更多信息。
贡献
请参阅CONTRIBUTING以获取详细信息。
安全漏洞
请通过电子邮件至me@dominik-eller.de报告安全漏洞,而不是使用问题跟踪器。
鸣谢
许可
MIT许可(MIT)。请参阅许可文件以获取更多信息。