這里寫問題描述
webman 如何吧URL 生成二維碼
安裝二維碼依賴庫
composer require chillerlan/php-qrcode
use chillerlan\QRCode\QRCode;
$url='https://baidu.com';
$QRCode = new QRCode();
$img_content = $QRCode->render($url);
//返回圖片連接,然后前端修改img的url
return json(['url'=>$img_content]);
//或者直接返回圖片
$img='<img src="'.$img_content.'">';
return response($img, 200);