Generate QR Code in Laravel 6

Hello Friends, Today I will teach how to Generate QR Code using Laravel 6.

Basically, QR Code using in generally most of the Industries like banking, currency transform and another firm to get the value and save time.

QR codes can be used to store bank account information or credit card information, or they can be specifically designed to work with particular payment provider applications. There are several trial applications of QR code payments across the world.

QR Codes application in the field of construction has already been started in India which helps in saving time, paper and energy. QR Code usage in Safety Vertical of Construction industry aids in the usage of Resources, allocation of time and usage of critical information. The dynamic nature of Construction Industry requires the need for dynamic technologies and QR Code aids in developing that technology for future usages.

So, Let’s Start our tutorial.


Step 1: Install-Package of QR Code.

Laravel will not provide QR Code Generate directly. So, We have to Install the package Composer in Laravel.

Open Your Terminal and put the below Code.

composer require simplesoftwareio/simple-qrcode

After Successfully install the package now move to the next step.

Step 2: Changes in Config File.

Now Open your config/app.php file and put the below code.

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

Step 3: Create a Route

Open web.php and put the below code.

Route::get('qrcode', 'QRCodeController@qrCode')->name('qrcode');

Step 4: Changes in Controller.

Now Open your QRCodeController.php and put the below code.


namespace App\Http\Controllers;

use Illuminate\Http\Request;
use QrCode;

class QRCodeController extends Controller{
	public function qrCode(){  
    	  return QrCode::size(500)->generate('A tutorial of QR code!');	

Now Open the browser and put the below code:


Happy Coding!

About Dhaval Shah

My name is Dhaval Shah. I'm a Laravel developer. I live in India and I love to write tutorials and tips that can help other developers. I am a big fan of PHP, Java-script, JQuery, Laravel, WordPress, and Bootstrap.
Follow me on Github / Linkedin

Leave a Reply

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter
Enter your email to receive a weekly round-up of our best posts. Learn more!