Simple QR, Generate codes in Laravel

QR codes are in fashion and serve to extend our application in a simple and visual way, sharing a QR code that can internally process the application using a discount code or URL, we can use the following package:

https://github.com/SimpleSoftwareIO/simple-qrcode

To install it:

$ composer require simplesoftwareio/simple-qrcode

Let's look at some examples. how to use it:

QrCode::format('svg')->size(700)->color(255,0,0)->generate('Desarrollo libre Andres', '../public/qrcodes/qrcode.svg');
QrCode::format('png')->size(700)->color(255, 0, 0)->merge('/assets/img/logo.png', .3, true)->generate('Desarrollo libre Andres', '../public/qrcodes/qrcode.png');

The package is very self-descriptive, the format, we indicate the image format, the color in RGB, the text to be converted into QR and the location of the file.

As you can see, like the previous parameters we can indicate aspects such as the format, size, color and content of the QR that is then generated in some location of the application, in this example, within the public folder.

- Andrés Cruz

En español

This material is part of my complete course and book; You can purchase them from the books and/or courses section, Curso y libro Laravel 11 con Tailwind Vue 3, introducción a Jetstream Livewire e Inerta desde cero - 2024.

Andrés Cruz

Develop with Laravel, Django, Flask, CodeIgniter, HTML5, CSS3, MySQL, JavaScript, Vue, Android, iOS, Flutter

Andrés Cruz In Udemy

I agree to receive announcements of interest about this Blog.