0

I'm trying to setup MongoDB in a Laravel Jetstream + Sail.

What I'm doing is trying to install the following packages:

  • mongodb/mongodb
  • jenssegers/mongodb

but I get the following errors :

 Problem 1
- jenssegers/mongodb[v3.8.0, ..., v3.8.2] require mongodb/mongodb ^1.6 -> satisfiable by mongodb/mongodb[1.6.0, ..., 1.9.x-dev (alias of dev-master)].
- mongodb/mongodb 1.9.x-dev is an alias of mongodb/mongodb dev-master and thus requires it to be installed too.
- mongodb/mongodb dev-master requires ext-mongodb ^1.10.0 -> it is missing from your system. Install or enable PHP's mongodb extension.
- mongodb/mongodb[1.6.0, ..., v1.6.x-dev] require php ^5.6 || ^7.0 -> your php version (8.0.2) does not satisfy that requirement.
- mongodb/mongodb[1.7.0-beta1, ..., v1.7.x-dev] require php ^7.0 -> your php version (8.0.2) does not satisfy that requirement.
- mongodb/mongodb[1.8.0-RC1, ..., v1.8.x-dev] require ext-mongodb ^1.8.1 -> it is missing from your system. Install or enable PHP's mongodb extension.
- Root composer.json requires jenssegers/mongodb ^3.8 -> satisfiable by jenssegers/mongodb[v3.8.0, v3.8.1, v3.8.2].

like suggested in this: Why does composer complain about the ext-mongo extension?

I added to my composer.json the following

"provide" : {
    "ext-mongo": "*"
},

But nothing changed, I also tried adding the package:

"soyuka/stubs-mongodb": "^1.0",

But same problems.

Thanks Mauro

Mauro
  • 2,175
  • 1
  • 9
  • 17
  • `provide` just claims that anything is installed on the system. That does not really install anything, so don't expect anything to work – Nico Haase Feb 17 '21 at 21:36
  • `mongodb/mongodb dev-master requires ext-mongodb` - so why not simply install `ext-mongodb`? The linked post talks about `ext-mongo` – Nico Haase Feb 17 '21 at 21:37

1 Answers1

1

The solution was to publish Sail docker files and add:

php8.0-mongodb

in /docker/8.0/DockerFile

Building and running:

sail composer require jenssegers/mongodb
Mauro
  • 2,175
  • 1
  • 9
  • 17