Laravel框架中二维码生成 阿星小栈

QrCode::format('png')->size(108)->margin(10)->errorCorrection('H')->generate($qrCodeContent, public_path('/qrcodes/mqrcode/'.$qrCode.'.png'));

size() : 生成图片大小

margin(): 边距  和css中margin一个意思

errorCorrection(): 容错率 , 也就是有被覆盖的区域还能识别,分别是  L(QR_ECLEVEL_L,7%),M(QR_ECLEVEL_M,15%),Q(QR_ECLEVEL_Q,25%),H(QR_ECLEVEL_H,30%); 

posted @ 2017-12-29 15:22  阿星小栈  阅读(757)  评论(0)    收藏  举报