Raviya Technical
Published in

Raviya Technical

Laravel with Packages | Laravel 8 QR Code Generate Example

Step 1: Install Laravel 8

composer create-project --prefer-dist laravel/laravel blog

Step 2: Install simple-QRcode Package

composer require simplesoftwareio/simple-qrcode
'providers' => [....SimpleSoftwareIO\QrCode\QrCodeServiceProvider::class],'aliases' => [....'QrCode' => SimpleSoftwareIO\QrCode\Facades\QrCode::class],
<?phpRoute::get('qr-code-g', function () {

\QrCode::size(500)
->format('png')
->generate('raviyatechnical', public_path('images/qrcode.png'));

return view('qrCode');

});

Step 4: Create a Blade file

<!DOCTYPE html><html><head><title>How to Generate QR Code in Laravel 8? - raviyatechnical</title></head><body><div class="visible-print text-center"><h1>Laravel 8 - QR Code Generator Example</h1>{!! QrCode::size(250)->generate('raviyatechnical'); !!}<p>example by raviyatechnical.</p></div></body></html>

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store