mercredi 13 mars 2019

How I store a Qrcode into DB and retrieve it in Laravel

There is no step by step documentation how I save qr code into database and retrieve it. I have tried to create a code that records the path of qrcode in the database, but my problem that the display in my member card does not exist . I have tried below way:

Controller for store QR code into database:

  public function card(Request $request){

    $cards = new Card();

    $cards->nom = request('nom');
    $cards->prenom = request('prenom');
    $cards->cin = request('cin');
    $cards->dateNaissance = request('dateNaissance');
    $cards->dateAffection = request('dateAffection');
    $qrcode = 'amal';
    $path= public_path() . '/storage/uploads';
    QRCode::format('png')->size('150')->generate($qrcode,$path);
    $cards->qrcode_membre =  $path;

    $cards->save();

return redirect('/membre/carte');
  }

And blade to viewing it:

 <img src="  "  alt="">

Please give me an solution. I am very worry about this. Thanks in advance.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2F7ZFah
via IFTTT

Aucun commentaire:

Enregistrer un commentaire