add mongodb

This commit is contained in:
iVampireSP.com 2022-09-14 21:27:27 +08:00
parent 86cfe11de5
commit 0e5e6ab68d
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132
3 changed files with 25 additions and 0 deletions

View File

@ -21,6 +21,13 @@ DB_DATABASE=homestead
DB_USERNAME=homestead DB_USERNAME=homestead
DB_PASSWORD=secret DB_PASSWORD=secret
MONGO_DB_HOST=127.0.0.1
MONGO_DB_PORT=27017
MONGO_DB_DATABASE=homestead
MONGO_DB_USERNAME=homestead
MONGO_DB_PASSWORD=secret
MONGO_DBDB_AUTHENTICATION_DATABASE=admin
LARAVELS_LISTEN_IP=127.0.0.0 LARAVELS_LISTEN_IP=127.0.0.0
ALIPAY_APP_ID= ALIPAY_APP_ID=

View File

@ -115,6 +115,9 @@
// $app->register(App\Providers\EventServiceProvider::class); // $app->register(App\Providers\EventServiceProvider::class);
$app->register(\Anik\Form\FormRequestServiceProvider::class); $app->register(\Anik\Form\FormRequestServiceProvider::class);
$app->register(App\Providers\RouteBindingServiceProvider::class); $app->register(App\Providers\RouteBindingServiceProvider::class);
$app->register(Jenssegers\Mongodb\MongodbServiceProvider::class);
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Load The Application Routes | Load The Application Routes

View File

@ -65,6 +65,21 @@
'search_path' => env('DB_SCHEMA', 'public'), 'search_path' => env('DB_SCHEMA', 'public'),
'sslmode' => env('DB_SSL_MODE', 'prefer'), 'sslmode' => env('DB_SSL_MODE', 'prefer'),
], ],
'mongodb' => [
'driver' => 'mongodb',
'host' => env('MONGO_DB_HOST', '127.0.0.1'),
'port' => env('MONGO_DB_PORT', 27017),
'database' => env('MONGO_DB_DATABASE', 'homestead'),
'username' => env('MONGO_DB_USERNAME', 'homestead'),
'password' => env('MONGO_DB_PASSWORD', 'secret'),
'options' => [
// here you can pass more settings to the Mongo Driver Manager
// see https://www.php.net/manual/en/mongodb-driver-manager.construct.php under "Uri Options" for a list of complete parameters that you can use
'database' => env('MONGO_DBDB_AUTHENTICATION_DATABASE', 'admin'), // required with Mongo 3+
],
],
], ],
/* /*