---
title: "How to Generate QR Code in Laravel 9?"
url: "https://magecomp.com/blog/generate-qr-code-laravel-9/"
date: "2023-11-06T13:16:37+00:00"
modified: "2025-01-31T13:18:29+00:00"
author:
  name: "Bharat Desai"
  url: "https://magecomp.com"
categories:
  - "Laravel"
word_count: 367
reading_time: "2 min read"
summary: "Hello Laravel Friends,"
description: "Learn How to Generate a QR Code in Laravel 9 using the "Simple-QR-Code” package."
keywords: "Laravel"
language: "en"
schema_type: "Article"
related_posts:
  - title: "Laravel 13: How to Generate Secure Temporary Links Using Signed URLs"
    url: "https://magecomp.com/blog/laravel-13-generate-secure-temporary-links-using-signed-urls/"
  - title: "Laravel 12: How to Build Advanced Search with Laravel Scout"
    url: "https://magecomp.com/blog/advanced-search-with-laravel-scout/"
  - title: "How to Set Up Automatic Daily Database Backup with Laravel 12"
    url: "https://magecomp.com/blog/set-up-automatic-daily-database-backup-laravel-12/"
---

# How to Generate QR Code in Laravel 9?

_Published: November 6, 2023_  
_Author: Bharat Desai_  

![](https://magecomp.com/blog/wp-content/uploads/2023/11/How-to-Generate-QR-Code-in-Laravel-9-1024x512.webp)

**Hello Laravel Friends,**

In today’s blog file, I will explain How to Generate a QR Code in Laravel 9.
QR code can be a valuable addition to your Laravel project. Assigning a QR code to each product helps to efficiently manage inventory and simplify the tracking process.
[![Laravel Development Services](https://magecomp.com/blog/wp-content/uploads/2024/12/Laravel-Development-Services-4.webp)](https://magecomp.com/services/laravel-development-services/)

Creating a QR code in Laravel 9 can be achieved using a package called “Simple-QR-Code.” This package provides a simple and straightforward way to generate QR codes for various content types. Here, I’ll guide you through the process step by step.
## Steps to Generate QR Code in Laravel 9:
**Step 1:** Create a Laravel project using the below command
```
composer create-project laravel/laravel:^9.0 your-project-name
```

**Step 2:** Now install the package simplesoftwareio/simple-qrcode to generate the QR code
Use the below command
```
composer require simplesoftwareio/simple-qrcode "~4"
```

[![Hire laravel Developer](https://magecomp.com/blog/wp-content/uploads/2024/12/Hire-Laravel-Expert-Now-3.webp)](https://magecomp.com/services/hire-laravel-developer/)

**Step 3:** Add the below lines in the service provider
```
'providers' => [
    SimpleSoftwareIOQrCodeQrCodeServiceProvider::class
],
```

And aliases in config/app.php
```
'aliases' => [
    'QrCode' => SimpleSoftwareIOQrCodeFacadesQrCode::class
],
```

**Step 4:** Create one route in the web.php file and create one blade file in the view folder to show the QR code
**path – routes/web.php**

```
Route::get('/', function () {
    return view('welcome');
});
```

**path – resources/views/welcome.blade.php**

```

<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Laravel QR Blog</title>

</head>

<body class="antialiased">
            {!! QrCode::generate('Make me into a QrCode!') !!}
    </body>

</html>
```

Now, you can run it in your browser and check it.
**Output:**

![QR code](https://magecomp.com/blog/wp-content/uploads/2023/11/QR-code.png)

**Step 5:** You can change the color of the QR code using the below code
```
{!! QrCode::size(150)->color(75, 0, 130)->generate('Make me into a QrCode!') !!}
```

**Output:**

![QR code color](https://magecomp.com/blog/wp-content/uploads/2023/11/QR-code-color.png)

## Conclusion:
Hence, using the above method, you can easily generate a QR code in your Laravel 9 application and change its color as per your requirement. If you have any doubts about generating the QR code for your Laravel application, let me know through the comment section, or you can connect with [**experienced Laravel Developers**](https://docs.google.com/document/u/0/d/1-TWUOGIUVyULG6eSo6HMoiqHuLWnvfDQAWMY3KxBEJo/edit) to further customize QR codes for your Laravel project.
[![Contact Us](https://magecomp.com/blog/wp-content/uploads/2024/12/Contact-Us-3.webp)](https://magecomp.com/contact)

**Happy Coding!**

</body></html>


---

_View the original post at: [https://magecomp.com/blog/generate-qr-code-laravel-9/](https://magecomp.com/blog/generate-qr-code-laravel-9/)_  
_Served as markdown by [Third Audience](https://github.com/third-audience) v3.5.3_  
_Generated: 2026-08-24 13:26:57 UTC_  
