saloon icon indicating copy to clipboard operation
saloon copied to clipboard

Conflicts on new fresh laravel application (11.5)

Open ces27 opened this issue 1 year ago • 12 comments

composer require saloonphp/laravel-plugin "^3.0" does not work anymore on Laravel 11.5 version, giving conflicts.

ces27 avatar Dec 29 '24 23:12 ces27

Hey, @ces27. Could you just post the output you get?

I haven't tried running the command, but just to ensure you don't get different conflicts than others, and, what conflicts you actually do get.

juse-less avatar Dec 31 '24 16:12 juse-less

@juse-less just got this myself...

Your requirements could not be resolved to an installable set of packages.

Problem 1 - Root composer.json requires saloonphp/laravel-plugin 3.0 -> satisfiable by saloonphp/laravel-plugin[v3.0.0]. - saloonphp/laravel-plugin v3.0.0 requires illuminate/console ^9.52 || ^10.0 -> found illuminate/console[v9.52.0, ..., v9.52.16, v10.0.0, ..., v10.48.25] but these were not loaded, likely because it conflicts with another require.

jzpeepz avatar Jan 03 '25 04:01 jzpeepz

Yes, that's exactly the conflicts I had

ces27 avatar Jan 03 '25 23:01 ces27

Hmm. Unfortunately I'm unable to replicate this one.

I've attached a recording, where I'm running below command, and then just hit enter on each question for the default options.

laravel new saloon-laravel-plugin-test && cd $_ && composer require saloonphp/laravel-plugin "^3.0"
Recording

https://github.com/user-attachments/assets/ec1f8d98-3203-465b-bd53-e1694a17e106

In the recording, I'm running PHP 8.3, Laravel Installer 5.11.0, and Composer 2.8.4. However, I also tested with all combinations of below, as I had some old Composer-, and Laravel Installer laying around:

  • Composer 2.7.8
  • Composer 2.8.3
  • Laravel Installer 5.8.5
  • Laravel Installer 5.11.0
  • PHP 8.2
  • PHP 8.3
  • PHP 8.4

Is it possible to write down the steps you're taking, and version of software involved (like Composer, Laravel Installer, PHP, ...)? Maybe you could create a repo with the fresh Laravel installation and post in here so I can clone it and go from there.

juse-less avatar Jan 05 '25 04:01 juse-less

Here are some of my details:

  • Windows 11
  • Powershell for terminal
  • Laravel 11.35.1
  • PHP 8.3.15
  • Composer 2.8.3
  • Laravel Installer 5.10.0

I will work on seeing if I can reproduce, but I figure this might be helpful in the meantime. Especially if @ces27 has something in common. I only mentioned Windows and Powershell because it is my first time to ever use Windows for Laravel development without giving up in frustration. 🙂

jzpeepz avatar Jan 05 '25 04:01 jzpeepz

Edit 2: Deleting this to avoid confusion. See my other comment.

jzpeepz avatar Jan 05 '25 05:01 jzpeepz

@juse-less here is a simple repo with the issue: https://github.com/jzpeepz/saloon-laravel-plugin-test

Here is how I set it up:

laravel new saloon-laravel-plugin-test

  • No starter kit
  • sqlite
  • Run migrations now? No

cd saloon-laravel-plugin-test

composer require saloonphp/laravel-plugin "^3.0"

jzpeepz avatar Jan 05 '25 06:01 jzpeepz

@ces27 Here is how I got it working in my project.

I updated my composer.json from:

"saloonphp/saloon": "3.0",

to

"saloonphp/saloon": "^3.0",

Then I ran composer update.

After that I ran composer require saloonphp/laravel-plugin "^3.5.0"

Boom!

jzpeepz avatar Jan 05 '25 06:01 jzpeepz

@jzpeepz I'll have a look a bit later today.

I'm scratching my head on this one a bit. The versions of software, and installation steps both of us take aren't too far off. So I can't really see that there'd be an issue related to that. I can partly see how platform difference could be an issue, but kinda feels far-fetched in this case.

One thing I didn't test was to clear my Composer cache, which I'll play with later.

composer clear-cache

I'll also try a few Linux-based machines, to see if there's anything different there.

juse-less avatar Jan 05 '25 07:01 juse-less

@jzpeepz I guess you can disregard my previous message. I didn't see you had posted the solution in your case, until I posted my message.

But that would explain why Composer really wanted to target Saloon 3.0, rather than 3.5.

Just so you know, when installing the Laravel plugin, you don't need to install Saloon itself. The Laravel plugin already requires Saloon. https://github.com/saloonphp/laravel-plugin/blob/15be0d587e61f11076f93d6df30561b88ff837c1/composer.json#L25

Maybe the documentation needs some clarification around that.

juse-less avatar Jan 05 '25 07:01 juse-less

Thanks for your help on this one @juse-less it sounds like setting it to 3.0 and not ^3.0 was the issue. There's been a lot of changes since 3.0 exactly and perhaps it was limiting the Laravel Plugin to a specific version as well, causing it to expect an older Laravel version.

Sammyjo20 avatar Jan 05 '25 13:01 Sammyjo20

@Sammyjo20 I'm not quite sure what happened. But I also think it's related to transitive dependencies.

saloonphp/laravel-plugin updated from saloonphp/saloon ^3.0 to ^3.5 in version 3.3, so it makes sense to not be able to install the Laravel Plugin 3.3 and above.

But I'm still curious why the output is for Laravel Plugin 3.0.0, rather than, say, 3.2.0. I guess it's probably just that the output is truncated by Composer itself in situations like these. It probably tried all versions, but since

  • Laravel Plugin gained Laravel 11 support in version 3.5.0
  • Laravel Plugin requiring Saloon 3.5, and above, in version 3.3
  • The root package (app) requiring Saloon 3.0, explicitly

It couldn't resolve a version of all constraints.

Hopefully this is the issue for @ces27, as well.

But ultimately; install saloonphp/saloon, or, saloonphp/laravel-plugin. Less risk of conflicts, and the Laravel Plugin already requires Saloon.

juse-less avatar Jan 05 '25 14:01 juse-less

I'm going to close this issue for the moment as I've not had any issue installing Saloon in Laravel 11 and I'm unable to replicate the issue you've had.

I'm really happy to open this if you're still having issues.

Sammyjo20 avatar Jun 21 '25 11:06 Sammyjo20