Passport requires a different version of phpseclib/phpseclib than laravel/nova. So it is currently not possible to use both.
Using version ^10.1 for laravel/passport
./composer.json has been updated
Running composer update laravel/passport
Loading composer repositories with package information Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- laravel/passport[v10.1.0, ..., 10.x-dev] require phpseclib/phpseclib ^2.0 -> found phpseclib/phpseclib[2.0.0, ..., 2.0.x-dev] but the package is fixed to 3.0.x-dev (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.
- Root composer.json requires laravel/passport ^10.1 -> satisfiable by laravel/passport[v10.1.0, 10.x-dev].
I don't see this dependency in Nova's dependencies?
/cc @crynobone
- Conclusion: don't install laravel/passport[v10.1.0] | install phpseclib/phpseclib[2.0.8] (conflict analysis result)
- Conclusion: don't install phpseclib/phpseclib 2.0.8 (conflict analysis result)
- moontoast/math 1.2.1 requires phpseclib/bcmath_compat >=1.0.3 -> satisfiable by phpseclib/bcmath_compat[2.0.0].
- laravel/nova v3.9.4 requires moontoast/math ^1.1 -> satisfiable by moontoast/math[1.2.1].
- Root composer.json requires laravel/passport ^10.1 -> satisfiable by laravel/passport[v10.1.0, 10.x-dev].
Ok, figured out the error:
Nova installs phpseclib/bcmath_compat v2.0.0 and that installs phpseclib/phpseclib v3.0.3.
In other words, if I install Passport before Nova, it works.
That shouldn't matter. Also: moontoast/math doesn't has the dependency you listed above (phpseclib/bcmath_compat). It requires bcmath: https://github.com/moontoast/math/blob/master/composer.json#L14
Are you using a shim?
Yes, composer installed that for me:
https://github.com/ramsey/moontoast-math/blob/master/composer.json#L21
Yes, composer does have a bit of hiccup when you already installed a higher version of 3rd party package A which depends on package B not defined in the root composer.json and then installed another dependency that only support up to lower version of the same package B. This can be fixed either by following what you did above, or:
composer.lock (and maybe vendor folder) before making composer require on the failed installation so we can have a clean requirement.phpseclib/phpseclib, but I wouldn't advise this unless you need to interact with the package directly.@crynobone Removing composer.lock before running compose require laravel/passport (without removing vendor/) works 馃憤
Most helpful comment
Yes, composer does have a bit of hiccup when you already installed a higher version of 3rd party package A which depends on package B not defined in the root
composer.jsonand then installed another dependency that only support up to lower version of the same package B. This can be fixed either by following what you did above, or:composer.lock(and maybevendorfolder) before makingcomposer requireon the failed installation so we can have a clean requirement.phpseclib/phpseclib, but I wouldn't advise this unless you need to interact with the package directly.