Class Qrcode Not Found Laravel

Class Qrcode Not Found Laravel. If you have an error class ‘QrCode’ not found in laravel.

Follow this step for fixing an error

First install the composer using this command

composer require simplesoftwareio/simple-qrcode

Add the following in your web.php file

    Route::get('qr-code-g', function () {
            ->generate('', public_path('images/qrcode.png'));
return view('qrCode');

in your blade file called qrcode.blade.php must be like following

<!DOCTYPE html>
        <title>QR code Generator</title>
    <div class="visible-print text-center">
        <h1>Laravel 7 - QR Code Generator Example</h1> 
        {!! QrCode::size(250)->generate(''); !!} 

No need to add alias and provider in config/app.php when you use laravel 7

Need to run following command for install imagemagick

sudo apt-get update

sudo apt-get install -y imagemagick php-imagick

You can check the installation to run the command

php -m | grep imagick

If its successfully installed, it will show like following


Then, need to restart your apache server or reboot your system it will working fine.

The result