Search code examples
phplaravelqr-code

QRcode generated not storing in the path given


Using SimpleSoftwareIO/simple-qrcode, I am trying to generate QRCode and store it.

\QrCode::generate($reservation_id, '/assets/uploads/'.$reservation_id.'.svg');

Which returns following error,

"file_put_contents(/assets/uploads/15525609678807.svg): failed to open stream: No such file or directory",
"exception": "ErrorException",
"file": "/..../vendor/simplesoftwareio/simple-qrcode/src/SimpleSoftwareIO/QrCode/BaconQrCodeGenerator.php",
"line": 85, 


Solution

  • It works,

    \QrCode::generate($reservation_id, base_path().$reservation_id.'.svg');