PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, February 26, 2022

[FIXED] Class 'SimpleSoftwareIO\QrCode\QrCodeServiceProvider' not found in laravel 7

 February 26, 2022     laravel, php     No comments   

Issue

my php version is 7.4 and laravel version is 7.0

'providers' => [SimpleSoftwareIO\QrCode\QrCodeServiceProvider::class,],

Alias

'aliases' => ['QrCode' => SimpleSoftwareIO\QrCode\Facades\QrCode::class,],

In my composer.json file

"require": {
    "php": "^7.2.5",
    "fideloper/proxy": "^4.2",
    "fruitcake/laravel-cors": "^1.0",
    "guzzlehttp/guzzle": "^6.3",
    "laravel/framework": "^7.0",
    "laravel/tinker": "^2.0",
    "simplesoftwareio/simple-qrcode": "^3.0"
},

here is error image

After adding alias and provider cant able to run any command in laravel root path its shows error like this

In ProviderRepository.php line 208: Class 'SimpleSoftwareIO\QrCode\QrCodeServiceProvider' not found

Solution

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 () {
    \QrCode::size(500)
            ->format('png')
            ->generate('www.google.com', public_path('images/qrcode.png'));
return view('qrCode');
});

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

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

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

imagick

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

Click Here to check final result.



Answered By - manikandan
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing