Framework: Carbon conflict versions

Created on 24 Jul 2018  Â·  30Comments  Â·  Source: laravel/framework

  • Laravel Version: 5.6.25
  • PHP Version: 7.2.7
  • Database Driver & Version: mysql 5.7

Description:

I need some carbon methods, but this methos aren't available.
I tried update carbon, but...

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

Problem 1
- laravel/framework v5.6.25 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.25 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.25 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.25, required as 5.6.*) -> satisfiable by laravel/framework[v5.6.25].

### Steps To Reproduce:
Put in some view $model->created_at->localeMonth

var_dump($dt->localeMonth); // string(7) "Oktober"
var_dump($dt->shortLocaleMonth); // string(3) "Okt"

And I received this error 

"Unknown getter 'localeMonth' (View: /home/igor/projetos/portalcea/resources/views/front/index.blade.php)"
```

This method above are available on Carbon docs

Most helpful comment

You can alias the new version as 1.25:

"nesbot/carbon": "1.32.0 as 1.25",

All 30 comments

I updated the app to laravel 5.6.28 and same error:

$ composer require nesbot/carbon
Using version ^1.32 for nesbot/carbon
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laravel/framework v5.6.28 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.28 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.28 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.28, required as 5.6.*) -> satisfiable by laravel/framework[v5.6.28].


Installation failed, reverting ./composer.json to its original content.

That is because laravel/framework has locked Carbon to version 1.25.*
https://github.com/laravel/framework/blob/5.6/composer.json#L26

while latest carbon version is 1.32.0

I also have this issue couple days ago. Since the Carbon version is locked to 1.25.*, I ended up recreating the method I need in my application. Is there any solution to have latest Carbon version (1.32.0) while using Laravel 5.6?

You can alias the new version as 1.25:

"nesbot/carbon": "1.32.0 as 1.25",

Do you recommend me a workaround? How I will deploy this on server?

It would be nice if we can use Carbon 1.29.0 or higher for CarbonPeriod.

Maybe if you update Laravel to a new version that supports the version of Carbon you need the functions will be available.

I updates already, do not works, see messages below.

Em sex, 27 de jul de 2018 18:42, Gabs notifications@github.com escreveu:

Maybe if you update Laravel to a new version that supports the version of
Carbon you need the functions will be available.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/laravel/framework/issues/24961#issuecomment-408545900,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACs-SR6M_WOQ99bRPJjC4tLZ7Szx9wB0ks5uK4lXgaJpZM4VeMFf
.

Why closed without answer?

5.7 doesn't lock the carbon version.

Ok, thank you very much.

The 5.7 version already date to leave?

5.7 release will be released at the end of this month, probably with Laracon EU.

Hello,
I'm working on my first project which is built with Laravel and my other projects built with CakePHP. In CakePHP, they organize all issues into milestones with a due date for each milestone also they have a roadmap for each minor release into their GitHub wiki page. Does Laravel has something like this so we can know what is coming in the new releases? I'm so sorry if this already exists as I'm new in Laravel.
Thanks

@BassemN theoretically the milestones laravel is in each 6 months.

@IgorDePaula Thanks allot and where can I find these milestones with its new features?

Laravel 5.7 fresh install + first time carbon installing

λ composer require nesbot/carbon
Using version ^2.1 for nesbot/carbon
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laravel/framework v5.7.0 requires nesbot/carbon ^1.26.3 -> satisfiable by nesbot/carbon[1.26.3, 1.26.4, 1.27.0, 1.28.0, 1.29.0, 1.29.1, 1.29.2, 1.30.0, 1.31.0, 1.31.1, 1.32.0, 1.33.0] but these conflict with your requirements or minimum-stability.
    - laravel/framework v5.7.0 requires nesbot/carbon ^1.26.3 -> satisfiable by nesbot/carbon[1.26.3, 1.26.4, 1.27.0, 1.28.0, 1.29.0, 1.29.1, 1.29.2, 1.30.0, 1.31.0, 1.31.1, 1.32.0, 1.33.0] but these conflict with your requirements or minimum-stability.
    - laravel/framework v5.7.0 requires nesbot/carbon ^1.26.3 -> satisfiable by nesbot/carbon[1.26.3, 1.26.4, 1.27.0, 1.28.0, 1.29.0, 1.29.1, 1.29.2, 1.30.0, 1.31.0, 1.31.1, 1.32.0, 1.33.0] but these conflict with your requirements or minimum-stability.
    - Installation request for laravel/framework (locked at v5.7.0, required as 5.7.*) -> satisfiable by laravel/framework[v5.7.0].


Installation failed, reverting ./composer.json to its original content.

you cannot install v2 of Carbon, Laravel 5.7 requires v1.

@browner12 as you see i just tried with default command line composer require nesbot/carbon

Questions

  1. Why I cannot get latest updates of carbon?
  2. What command should I use to install it?

Yet this problem? I not believe that carbon dependence not upgraded in laravel 5.7.

@IgorDePaula even 5.6 can't install carbon :))

carbon is already included in Laravel's requirements.

https://github.com/laravel/framework/blob/5.7/composer.json#L26

You do not need to do anything additionally to install it.

You cannot get the latest version of Carbon because Laravel requires version 1.

My God

Can we upgrade it to v2.1.0 please?

cc: @themsaid @taylorotwell

you don't need to ping them, they are very aware of which Carbon version we are on.

Unfortunately this is not a simple upgrade, and since Carbon is relatively tightly integrated with Laravel, this upgrade will require some work.

Any moderator, could we lock this issue down? We seem to be getting a little off track.

Work is underway but needs some time and won't be in 5.7 any way, see https://github.com/laravel/framework/pull/25320 .

(And it's generously done by the top contributor to Carbon, too)

@browner12 Thanks for the response. The only reason I tagged them was because I felt this issue required their intervention.

Glad that we have a PR for this now 😄.

hahaha, include in laravel now .... cool

Only in laravel 5.8 proposal. more 6 months =/

Yeah.... That's kind of sad... Will have to create custom functions until then... 😞

Was this page helpful?
0 / 5 - 0 ratings

Related issues

progmars picture progmars  Â·  3Comments

shopblocks picture shopblocks  Â·  3Comments

RomainSauvaire picture RomainSauvaire  Â·  3Comments

JamborJan picture JamborJan  Â·  3Comments

digirew picture digirew  Â·  3Comments