PHP code example of prgayman / laravel-qrcodemonkey

1. Go to this page and download the library: Download prgayman/laravel-qrcodemonkey library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

prgayman / laravel-qrcodemonkey example snippets


use Prgayman\QRCodeMonkey\QRCode\CustomeGenerate;

$generate = new CustomeGenerate();
$qrcode = $generate->setType("email") // QRCode Type Generate
    ->setData([
        "email"=>"[email protected]",
        "subject"=>"QRCode Monkey Api",
        "body"=>"Test Send Mail"
    ])
    ->setFileType("svg")
    ->getQRCode();
echo $qrcode;

$generate = new CustomeGenerate();
/**
* @param string $type [ phone,sms, email, text, url, location,  wifi, bitcoin, event]
*/
$qrcode->setType($type);

$generate = new CustomeGenerate();
/**
* @param string $platform [android,ios,web]
*/
$qrcode->setPlatform($platform);

$generate = new CustomeGenerate();
/**
* @param string $fileType [svg,png,eps,pdf]
*/
$qrcode->setFileType($fileType);

$generate = new CustomeGenerate();
/**
* @param string $size
*/
$qrcode->setSize($size);

$generate = new CustomeGenerate();
/**
* @param string $hexColor
*/
$qrcode->setBgColor($hexColor);

$generate = new CustomeGenerate();
/**
* @param string $hexColor
*/
$qrcode->setBodyColor($hexColor);

$generate = new CustomeGenerate();
/**
* @param string $eye1Color default value (#000000)
* @param string $eye2Color default value (#000000)
* @param string $eye3Color default value (#000000)
*/
$qrcode->setEyeColors($eye1Color, $eye2Color, $eye3Color)

$generate = new CustomeGenerate();
/**
* @param string $eyeBall1Color default value (#000000)
* @param string $eyeBall2Color default value (#000000)
* @param string $eyeBall3Color default value (#000000)
*/
$qrcode->setEyeBallColors($eyeBall1Color, $eyeBall2Color, $eyeBall3Color)

$generate = new CustomeGenerate();
/**
* @param string $gradientColor1 default value (null)
* @param string $gradientColor2 default value (null)
*/
$qrcode->setGradientColors($gradientColor1, $gradientColor2)

$generate = new CustomeGenerate();
/**
* @param string $type [linear, radial]
*/
$qrcode->setGradientType($type)

$generate = new CustomeGenerate();
/**
* @param string $mode [default, clean]
*/
$qrcode->setLogoMode($mode)

$generate = new CustomeGenerate();
/**
* @param string $logo url logo
*/
$qrcode->setLogo($logo)

$generate = new CustomeGenerate();
$qrcode->gradientOnEyes()

$generate = new CustomeGenerate();
$qrcode->getQRCode()

$generate = new CustomeGenerate();
$qrcode->donwload()

$generate = new CustomeGenerate();

/**
* @param string $shape
*/
$qrcode->setBodyShape($shape);

// Get Body Shape Supported
use Prgayman\QRCodeMonkey\Support\Shapes;
$bodyShape = Shapes::bodyShape(); // Get Body Shape supported keys
$bodyShapeImgs = Shapes::getBodyShapeImg(); // Get Body Shape supported keys with image url


$generate = new CustomeGenerate();

/**
* @param string $shape
*/
$qrcode->setEyeShape($shape);

// Get Eye Shape Supported
use Prgayman\QRCodeMonkey\Support\Shapes;
$eyeFrameShape = Shapes::eyeFrameShape(); // Get Eye Shape supported keys
$eyeFrameShapeImgs = Shapes::getEyeFrameShapeImg(); // Get Eye Shape supported keys with image url


$generate = new CustomeGenerate();

/**
* @param string $shape
*/
$qrcode->setEyeBallShape($shape);

// Get Eye Ball Shape Supported
use Prgayman\QRCodeMonkey\Support\Shapes;
$eyeBallShape = Shapes::eyeBallShape(); // Get Eye Ball Shape supported keys
$eyeBallShapeImg = Shapes::getEyeBallShapeImg(); // Get Eye Ball Shape supported keys with image url

sh
'providers' => [
    // ...
    Prgayman\QRCodeMonkey\QRCodeMonkeyServiceProvider::class,
];
sh
php artisan vendor:publish --provider="Prgayman\QRCodeMonkey\QRCodeMonkeyServiceProvider"