Goodabbasi / codehunter

0 stars 0 forks source link

InvalidArgumentException : Database [mongodb] not configured #1

Open Goodabbasi opened 4 years ago

Goodabbasi commented 4 years ago

Hi I am trying to connect MongoDB database with laravel framework. when I try to make a connection I received this error

InvalidArgumentException : Database [mongodb] not configured.

at C:\xampp\htdocs\laraveltest\Mongotest\vendor\laravel\framework\src\Illuminate\Database\DatabaseManager.php:152 148| // If the configuration doesn't exist, we'll throw an exception and bail. 149| $connections = $this->app['config']['database.connections']; 150| 151| if (is_null($config = Arr::get($connections, $name))) {

152| throw new InvalidArgumentException("Database [{$name}] not configured."); 153| } 154| 155| return (new ConfigurationUrlParser) 156| ->parseConfiguration($config);

Exception trace:

1 Illuminate\Database\DatabaseManager::configuration("mongodb") C:\xampp\htdocs\laraveltest\Mongotest\vendor\laravel\framework\src\Illuminate\Database\DatabaseManager.php:115

2 Illuminate\Database\DatabaseManager::makeConnection("mongodb") C:\xampp\htdocs\laraveltest\Mongotest\vendor\laravel\framework\src\Illuminate\Database\DatabaseManager.php:86

Please use the argument -v to see more details.

some one known how to fix that issue.

Goodabbasi commented 4 years ago

I am using jenssegers/laravel-mongodb and I follow all the steps but still receiving same error.