PHP code example of nordsoftware / lumen-doctrine-mongodb-odm

1. Go to this page and download the library: Download nordsoftware/lumen-doctrine-mongodb-odm library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

nordsoftware / lumen-doctrine-mongodb-odm example snippets


$app->register('Nord\Lumen\Doctrine\ODM\MongoDB\DoctrineServiceProvider');




return [
    'mapping'         => 'xml',
    'paths'           => [
        base_path('some/Domain/Path/To/Your/Infrastructure/Resources/ODM'),
        base_path('some/App'),
    ],
    'proxy'           => [
        'directory' => storage_path('doctrine/proxies'),
    ],
    'hydrator'        => [
        'directory' => storage_path('doctrine/proxies'),
    ],
];




return [
    'default' => env('MONGODB_DB_CONNECTION', 'mongodb'),
    'connections' => [
        env('MONGODB_DB_CONNECTION', 'mongodb') => [
            'host' => env('MONGODB_DB_HOST', 'localhost'),
            'database' => env('MONGODB_DB_DATABASE', 'forge'),
            'username' => env('MONGODB_DB_USERNAME', 'forge'),
            'password' => env('MONGODB_DB_PASSWORD', ''),
            'timezone' => env('MONGODB_DB_TIMEZONE', '+00:00'),
        ]
    ],
];