decorate/qr_manager

qr code support

v1.0.3 2022-02-04 08:24 UTC

This package is auto-updated.

Last update: 2024-03-04 13:28:35 UTC


README

install

composer require decorate/qr_manager

usage

<?php
use Decorate\QR_Manager;

QRコード表示

#controller
$user = User::query()->select(['id', 'name'])->first();
$qr = new QR_Manager($user);
$res = $qr->size(200)->show();
return view('index', ['data' => $res]);
<div>
    {!! $data !!}
</div>

QRコードダウンロード

#controller
$user = User::query()->select(['id', 'name'])->first();
$qr = new QR_Manager();
return $qr
    ->source($user)
    ->format('png')
    ->size(200)
    ->download('filename');

QRコードbase64

#controller
$user = User::query()->select(['id', 'name'])->first();
$qr = new QR_Manager();
return $qr
    ->source($user)
    ->format('png')
    ->size(200)
    ->toBase64();

Class Methods

methods args output
source Model or string this
format string this
size string this
show null HtmlString
download null \Illuminate\Http\Response
toBase64 null string