`laravel`框架作为一款优秀的`php`框架
有很多的第三方扩展包
其中就有可以生成`二维码`的扩展包
首先我们来安装扩展包
>composer require simplesoftwareio/simple-qrcode 1.3.*
然后在 config/app.php/providers中 注册服务提供者:
>SimpleSoftwareIO\\QrCode\\QrCodeServiceProvider::class
同样在 config/app.php 添加 QrCode 门面:
>'QrCode' => SimpleSoftwareIO\\QrCode\\Facades\\QrCode::class
在控制器中的简单使用
引用类:
>use SimpleSoftwareIO\\QrCode\\Facades\\QrCode;
return QrCode::encoding('UTF-8')->size(100)->generate('测试,生成二维码');
输出效果展示:
