mongodb / laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel (Moloquent)
https://www.mongodb.com/docs/drivers/php/laravel-mongodb/
MIT License
7.01k stars 1.43k forks source link

installing to existing Lumen Project has errors. #2145

Closed JenuelDev closed 3 years ago

JenuelDev commented 3 years ago

Description:

We have an existing project, We tried to install the jenssegers/mongodb package but it doesn't work.

Steps to reproduce

  1. composer require jenssegers/mongodb

Expected behaviour

It should install

Actual behaviour

when installing it added on the composer.json but did not install the package. and this is the error came out

image image

nickshore commented 3 years ago

The documentation states that 3.8 requires Laravel/Lumen 8. See here -> https://github.com/jenssegers/laravel-mongodb#laravel-version-compatibility

I can also see this aligns with the composer output message relating to jenssegers/mongdb v3.8.0 requiring illuminate/events greater than 8.0. The docs state Laravel/Lumen 6 will be supported by jensseger/mongodb version 3.6.*

divine commented 3 years ago

Hello,

Quite interesting why composer picked up version ^8 for your Lumen installation.

Just require version 3.6 for your installation.

Thanks!

nickshore commented 3 years ago

It will be the composer file for jenssegers/mongodb that is forcing the dependency check. See here -> https://github.com/jenssegers/laravel-mongodb/blob/master/composer.json


"require": {
        "illuminate/support": "^8.0",
        "illuminate/container": "^8.0",
        "illuminate/database": "^8.0",
        "illuminate/events": "^8.0",
        "mongodb/mongodb": "^1.6"
    }```
divine commented 3 years ago

It will be the composer file for jenssegers/mongodb that is forcing the dependency check. See here -> https://github.com/jenssegers/laravel-mongodb/blob/master/composer.json

I know, however composer should have picked up compatible version on it's own AFAIK.

Thanks!

JenuelDev commented 3 years ago

I was able to fix it now by updating my lumen to the latest version thanks.