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
1 reply
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

Please or to participate in this conversation.