vendredi 29 mars 2019

How to generate qrcode with data from mysql

Please help me how to generate qrcode with data from mysql.

This is my controller

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use DB;
use App\Http\Requests;
use App\Http\Controllers\Controller;

class QrController extends Controller
{

   public function make()
    {
        $pelajar_id = md5(time(). mt_rand(1,100000));

        $user = ('qr'.'/'.$pelajar_id.'.png');
        \QRCode::text($pelajar_id)->setOutFile($user)->png();
    }

}

This is my web.php

//qrcode
Route::get('/qrcode', 'QrController@make');

i just declare $pelajar_id to random variables because i dont know how to retrieve data from mysql. Please help me....



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire