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.