Mage laravel website eka MongoDb cluster ekka connect kranna giyama me error eka enava. meka fix karanne kohomada ?



  • ![alt text](![0_1584632797802_erro.JPG](Uploading 100%) image url)

    Mage laravel website eka MongoDb cluster ekka connect kranna giyama me error eka enava.
    laravel version eka 6 mage.

    code eka config my conf/database.php vala

    'mongodb_conn' => [
        'driver' => 'mongodb',
        'dsn'=>'mongodb+srv://myusername:[email protected]/test?retryWrites=true&w=majority',
        'database' => 'mydbname',
    ],
    

    .env eke code eka

     APP_NAME=My_laravel_web
    APP_ENV=local
    APP_KEY=base64:jtvoXduyfwnIB6A5pCy8Cfa9bJYRvNgMKeRFdfiYYyc=
    APP_DEBUG=true
    APP_URL=http://localhost
    
    LOG_CHANNEL=stack
    
    DB_CONNECTION=mongodb_conn'
    DB_HOST=xxxx-shard-00-00-uggj0.mongodb.net
    DB_PORT=27017
    DB_DATABASE=mydbname
    DB_USERNAME=myusername
    DB_PASSWORD=mypassword
    
    BROADCAST_DRIVER=log
    CACHE_DRIVER=file
    QUEUE_CONNECTION=sync
    SESSION_DRIVER=file
    SESSION_LIFETIME=120
    
    REDIS_HOST=127.0.0.1
    REDIS_PASSWORD=null
    REDIS_PORT=6379
    

    meka fix karanne kohomada

    error message eka

     php artisan serve
    
       InvalidArgumentException  : Database [mongodb_conn'] not configured.
    
      at C:\xampp\htdocs\bloodDonation\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'];
        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_conn'")
          C:\xampp\htdocs\bloodDonation\vendor\laravel\framework\src\Illuminate\Database\DatabaseManager.php:115
    
      2   Illuminate\Database\DatabaseManager::makeConnection("mongodb_conn'")
          C:\xampp\htdocs\bloodDonation\vendor\laravel\framework\src\Illuminate\Database\DatabaseManager.php:86
    
      Please use the argument -v to see more details.
    


  • bro oyage env eke DB_CONNECTION=mongodb_conn' kyna eke anthimata ' ekak wadila, ekai aula