Reputation: 461
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,
Upvotes: 0
Views: 2192
Reputation: 53
$path = '/assets/uploads/';
if(!\File::exists(public_path($path))) {
\File::makeDirectory(public_path($path));
}
$file_path = $path . $reservation_id . '.svg';
\QrCode::generate($reservation_id, $file_path);
I hope it will help you, this is work fine for me.
Upvotes: 0
Reputation: 461
It works,
\QrCode::generate($reservation_id, base_path().$reservation_id.'.svg');
Upvotes: 2