dominik-eller/laravel-qr-code

生成二维码

v1.1.0 2024-09-20 14:40 UTC

This package is auto-updated.

Last update: 2024-09-21 21:48:14 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

此包允许您生成二维码。

安装

您可以通过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)。请参阅许可文件以获取更多信息。