composer require chillerlan/php-qrcode
```php
$data = 'id=100&barn_id=125';
$QRCode = new QRCode();
$img_content = $QRCode->render($data);
$img_content = str_replace('data:image/png;base64,', '', $img_content);
return response(base64_decode($img_content), 200, ['Content-Type' => 'image/png']);
```