Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Sbrillo's avatar

simple qr code and laravel 12 (with starter kit), not possible?

Hello everyone, I’ve just registered on this forum. You have no idea how many times your posts have helped me over the years, but now I need help with something different.

I’m trying to use QR codes in my Laravel project (Laravel 12 with a starter kit and built-in authentication using Fortify). However, when I try to install Simple QR Code, I get the following error:

Problem 1 - Root composer.json requires simplesoftwareio/simple-qrcode * -> satisfiable by simplesoftwareio/simple-qrcode[1.0.1, ..., 1.5.1, 2.0.0, 3.0.0, 4.0.0, 4.1.0, 4.2.0]. - simplesoftwareio/simple-qrcode[1.0.1, ..., 1.5.1, 2.0.0] require bacon/bacon-qr-code 1.0.* -> found bacon/bacon-qr-code[1.0.0, 1.0.1, 1.0.2, 1.0.3] but the package is fixed to v3.1.1 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command. - simplesoftwareio/simple-qrcode 3.0.0 requires bacon/bacon-qr-code 2.0.0 -> found bacon/bacon-qr-code[2.0.0] but the package is fixed to v3.1.1 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command. - simplesoftwareio/simple-qrcode[4.0.0, ..., 4.2.0] require bacon/bacon-qr-code ^2.0 -> found bacon/bacon-qr-code[2.0.0, ..., 2.0.8] but the package is fixed to v3.1.1 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions. You can also try re-running composer require with an explicit version constraint, e.g. "composer require simplesoftwareio/simple-qrcode:*" to figure out if any version is installable, or "composer require simplesoftwareio/simple-qrcode:^2.1" if you know which you need.

I tried using the options suggested in the error message, but I kept running into more compatibility issues.

I suspected there might be a conflict related to bacon/bacon-qr-code, so I ran the command composer why bacon/bacon-qr-code to check which dependencies are using it. It turns out that Fortify depends on it.

At this point, I’m stuck: I can’t remove it, I can’t upgrade it, and I can’t install Simple QR Code. Am I missing something, or is there a workaround for this situation?

0 likes
3 replies
martinbean's avatar

@sbrillo Fortify already requires the bacon/bacon-qr-code package at version 3 (https://github.com/laravel/fortify/blob/fc66a38872a0e304748336d2975f37672c8fca9c/composer.json#L19). The package you’re trying to install wants version 1 of that package, which suggests the package you’re trying to install is massively outdated.

So given Fortify already adds bacon/bacon-qr-code to your Laravel application, just use it directly. You don’t need to install a package to generate QR codes when there’s literally already one installed.

1 like
alfredscheer's avatar

Yes — the problem is that simplesoftwareio/simple-qrcode is outdated and still requires bacon/bacon-qr-code ^2, while Laravel 12/Fortify already uses bacon/bacon-qr-code ^3.

So the packages are incompatible.

The easiest solution is to skip Simple QR Code and use Bacon QR Code directly, since it’s already installed in your project:

use BaconQrCode\Renderer\ImageRenderer; use BaconQrCode\Renderer\Image\SvgImageBackEnd; use BaconQrCode\Renderer\RendererStyle\RendererStyle; use BaconQrCode\Writer;

$renderer = new ImageRenderer( new RendererStyle(300), new SvgImageBackEnd() );

$writer = new Writer($renderer);

echo $writer->writeString('Hello Laravel 12');

Trying to force-install Simple QR Code with -W will likely break other dependencies.

ghabriel25's avatar

@sbrillo Use BaconQrCode that already included in fortify.

use BaconQrCode\Renderer\ImageRenderer;
use BaconQrCode\Renderer\Image\ImagickImageBackEnd;
use BaconQrCode\Renderer\RendererStyle\RendererStyle;
use BaconQrCode\Writer;

$renderer = new ImageRenderer(
    new RendererStyle(400),
    new ImagickImageBackEnd()
);
$writer = new Writer($renderer);
$writer->writeFile('Hello World!', 'qrcode.png');

Please or to participate in this conversation.