endroid / qr-code

QR Code Generator
https://endroid.nl
MIT License
4.46k stars 728 forks source link

Autoload not working #281

Closed amostajo closed 3 years ago

amostajo commented 4 years ago

I have installed the package via composer and placed the exact code sample:

use Endroid\QrCode\QrCode;

And then in the script:

$qrCode = new QrCode($data);
header('Content-Type: '.$qrCode->getContentType());
echo $qrCode->writeString();
die;

Got this error in return:

Class 'Endroid\QrCode\QrCode' not found

Note, that composer is working well on my project, this is the only package that is presenting autoloading problems.

Regards.

endroid commented 3 years ago

Hi @amostajo can you post a complete example of your code, including your autoload statement? It should contain something like require dirname(DIR).'/vendor/autoload.php'; (can be somewhat different, depending on where your script resides).