I tried in cmd "composer require nesbot/carbon" but I got this:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- laravel/framework v5.6.27 requires nesbot/carbon 1.25.* -> satisfiable by nesbot/carbon[1.25.0] but these conflict with your requirements or minimum-stability.
- laravel/framework v5.6.27 requires nesbot/carbon 1.25.* -> satisfiable by nesbot/carbon[1.25.0] but these conflict with your requirements or minimum-stability.
- laravel/framework v5.6.27 requires nesbot/carbon 1.25.* -> satisfiable by nesbot/carbon[1.25.0] but these conflict with your requirements or minimum-stability.
- Installation request for laravel/framework (locked at v5.6.27, required as 5.6.*) -> satisfiable by laravel/framework[v5.6.27].
Installation failed, reverting ./composer.json to its original content.
By default, Laravel 5.8 uses PHPUnit 7. However, you may optionally upgrade to PHPUnit 8, which requires PHP >= 7.2.
Updating DependenciesUpdate your laravel/framework dependency to ^6.0 in your composer. json file. If installed, update your laravel/passport dependency to ^9.3. 2 in your composer.
The Carbon class is a very useful class of the Laravel to work with the date and time. Different methods of this class have been used in the examples of this tutorial to print date and time in different ways and perform date and time-related tasks.
I don't recommend doing this without extreme caution because there may be a reason why Laravel, or any of your other dependencies, require a very strict version of a package.
With that said, Composer does include a neat trick to alias versions to get around this by specifying an alias version in composer.json
:
"require": {
...
"nesbot/carbon": "1.32.0 as 1.25.0"
},
Note the as 1.25.0
which will trick other packages into thinking 1.32.0
is equivalent to 1.25.0
for dependencies. This trick requires exact versions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With