Roots Discourse

How to get Carbon 2.x intalled in sage theme?

For a schedule table I have to perform some rounding of DateTime objects.
The PHP Carbon library got a function that does exactly what I need, but it has been introduced in 2,.x, not before.
The current sage 9 / 10 theme composer dependencies require Carbon 1.x.
I am unable to update the dependencies in a way that allows the installation of Carbon 2.x.

With illuminate/support:v5.7.28 Carbon 2.x is also allowed (not just from the 1.x branch).
However, the roots/sage-lib 9.0.9 package (which is also the latest, but the dev-master is not different in this regard) require illuminate/config ~5.6 which in turn requires an earlier release of illuminate/support:5.6.*, hence the installation of illuminate/support:v5.7.28 fails.

As composer can’t manage multiple versions of the same package (as in contrast to e.g. npm), it doesn’t seem to be possible to use Carbon 2.x in a sage project.
Is there still a way to get Carbon 2.x into a theme?

This topic was automatically closed after 42 days. New replies are no longer allowed.