leroy-merlin-br / mongolid-laravel

Easy, powerful and ultrafast MongoDB ODM for Laravel.
MIT License
240 stars 41 forks source link

Undefined index: driver #127

Closed MoraesGil closed 5 years ago

MoraesGil commented 5 years ago

Hi guys I've setup a fresh 5.5 laravel and try to install our package but, i got this error

`vendor\laravel\framework\src\Illuminate\Database\DatabaseManager.php

  1. if (isset($this->extensions[$driver = $config['driver']])) { `

them I add this line into database.php 'driver' => 'mongodb',

in

'mongo' => [ 'driver' => 'mongodb', 'host' => env('UNIFI_HOST', 'localhost'), 'port' => env('UNIFI_PORT', 27017), 'database' => env('UNIFI_DATABASE','admin'), 'username' => env('UNIFI_USERNAME'), 'password' => env('UNIFI_PASSWORD'), ],

them

Unsupported driver [mongodb]

it's package suported in Laravel 5.5 ?? also, can I connect into Mongo 2.4.9 database ?

ravanscafi commented 5 years ago

Hey @MoraesGil. Your database.php should look something like this:


return [

    'default' => 'mongodb',

    'connections' => [
        // NOT INSIDE HERE!
    ],

    // other configs...

    'mongodb' => [
        'default' => [
            'host' => env('DB_HOST', '127.0.0.1'),
            'port' => env('DB_PORT', 27017),
            'database' => env('DB_DATABASE', 'mongolid'),
            'username' => env('DB_USERNAME', null),
            'password' => env('DB_PASSWORD', null),
        ],
    ],

];

For compatibilty, I guess that it works right now, check here, but it will not on V3 (#126)

MoraesGil commented 5 years ago

@ravanscafi Thank you, I guess it worked but I got an error

Server at localhost:27117 reports wire version 0, but this version of libmongoc requires at least 3 (MongoDB 3.0)

My Database is 2.4.9 and I can't update it because this is used by Unifi Software that control the wifi internet access.

ravanscafi commented 5 years ago

Sorry, this library relies on MongoDB PHP Driver and you should look at its docs, it is not up to us. If you have have any more questions about mongolid, please reopen this issue.