Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

OzzDev's avatar

Root composer.json requires php ^7.0 but your php version (8.0.9) does not satisfy that requirement.

I have a context where I have a Laravel Nova cms and a colors model and migration/table and also a Color Nova Resource. The colors table has a column "hexcode" and I was checking the Laravel Nova documentation for a color picker field for this "hexcode" database column. But it seems that's not available at the moment.

I just found this package: composer require optimistdigital/nova-color-field

But running "composer require optimistdigital/nova-color-field" to install it I get:

Using version ^1.2 for optimistdigital/nova-color-field ./composer.json has been updated Running composer update optimistdigital/nova-color-field Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages.

Problem 1 - Root composer.json requires php ^7.0 but your php version (8.0.9) does not satisfy that requirement.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Do you know how to solve these kind of issue?

0 likes
4 replies
OzzDev's avatar

Like this:

composer require optimistdigital/nova-color-field --ignore-platform-reqs

It works. However doing the use like this "use OptimistDigital\NovaColorField\Color;" on the Color resource, it is not detecting this file, so it is not working. Do you know what can be the issue? Thanks!

rodrigo.pedra's avatar
Level 56

As you have php 8.0 installed, when you update your composer.json file it have a constraint about php version on it.

Search for a line like this on composer.json

"require": {
    "php": "7.0",

and change it to:

"require": {
    "php": "8.0",

Then run composer update before installing new packages. There might be some breaking changes, as third-party packages could have upgraded to a new major version and composer update could fail. You should manually review those when upgrading PHP versions in a project.

If you are pretty sure your project will run fine in PHP 8.0 (I wouldn't be so sure as third-party code can have breaking changes from version to version) you can also try running composer install with this flag: --ignore-platform-reqs, for example:

composer require optimistdigital/nova-color-field --ignore-platform-reqs

Lastly, if you don't feel confident on upgrading the project from a newer PHP version you could downgrade your local PHP installation, or have a second PHP installation just for this project.

2 likes
OzzDev's avatar

@rodrigo.pedra Thanks. But even like that changing to 8.0 or use the ignore reqs flag the use "use OptimistDigital\NovaColorField\Color;" on the Color resource is not recognized. I already ran composer dumpautoload but still dont works. Do you know what can be the issue?

rodrigo.pedra's avatar

@OzzDev I would try removing the vendor folder, the composer.lock file, and try installing all the dependencies (composer update) again to see if it helps.

1 like

Please or to participate in this conversation.