Laravellaravel 使用生成二维码扩展composer require simplesoftwareio/simple-qrcode 1.5.1 // 在config/app.php 注册服务提供者: SimpleSoftwareIO\QrCode\QrCodeServiceProvider::class // 在 config/app.php 添加 QrCode : 'QrCode' => S作者王明昌发布时间2019-01-12composer require simplesoftwareio/simple-qrcode 1.5.1复制// 在config/app.php 注册服务提供者: SimpleSoftwareIO\QrCode\QrCodeServiceProvider::class // 在 config/app.php 添加 QrCode : 'QrCode' => SimpleSoftwareIO\QrCode\Facades\QrCode::class复制use SimpleSoftwareIO\QrCode\Facades\QrCode;//引入Qrcode类 public function test(){ // echo "ceshi"; $url = '欢迎扫码测试~'; $img = public_path() . '/uploadfile/3.jpg';//文件 $filename = public_path() . '/uploadfile/3.png';//生成的文件路径+名称 // //使用QrCode类,生成二维码图片 //format() 修改二维码图片格式,目前仅支持PNG、SVG 和 EPS三种格式,必须在其他格式化方法前调用 QrCode::format('png') //size() 修改二维码图片尺寸:像素 ->size(198) //margin()二维码边距设置,默认为4 ->margin(2) //容错级别设置 L(7%)、M(15%)、Q(25%)、H(30%),容错级别越高,字节码回复率越大,二维码里能存储的数据越少 ->errorCorrection("L") //merge($filename, $percentage, $absolute)Logo或者头像放到二维码图片中,参数分别为 图片路径,百分比,切换绝对路径 ->merge($img, .3, true) //指定编码 ->encoding('UTF-8') //generate($text , $filename)$text 二维码数据 $filename 文件名及保存路径 ->generate($url, $filename); }
2019-01-10laravel多条件排序$goods = Goods::orderBy('created_at','desc')->orderBy('id','desc')->paginate(6);
2018-03-11laravel开发博客遇到的问题(一)1.引入css,js,img等最好使用asset 使用此方式,获取的是带域名的绝对路径 2.测试数据库是否连接正常数据库 use DB; $pdo = DB::connection()->getPdo
2019-02-09laravel新建应用报错:The Process class relies on proc_open, which is not#laravel new blog Crafting application... [Symfony\Component\Process\Exception\RuntimeException] The
2020-01-01laravel 使用 Editor.md关于图片上传csrf的处理 大家都知道laravel默认提交表单时是启用csrf验证的 那么关于Editor.md关于图片上传csrf的处理有两个 1. 关闭csrf验证  加入csrf验证 上传方法:  视图: 加入t
2019-01-12laravel migration 中integer方法无法指定长度查看源代码后发现integer方法的第二个参数并不是指定长度,而是是否设置auto increment, 所以integer方法无法指定子段长度,默认为11。
2019-02-09laravel5.4 | 加密/哈希加密 使用 Laravel 的加密器之前,必须在配置文件 config/app.php中设置 key 选项为 32 位随机字符串。可以使用 php artisan key:generate 命令来生成