Skip to content

Commit f02e13d

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents a8e8360 + 01dfe3c commit f02e13d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ The belongsToMany relation will not use a pivot "table" but will push id's to a
751751
If you want to define custom keys for your relation, set it to `null`:
752752

753753
```php
754-
use Jenssegers\Mongodb\Eloquent\Mode;
754+
use Jenssegers\Mongodb\Eloquent\Model;
755755

756756
class User extends Model
757757
{

src/Jenssegers/Mongodb/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function getDatabaseName()
128128
protected function getDefaultDatabaseName($dsn, $config)
129129
{
130130
if (empty($config['database'])) {
131-
if (preg_match('/^mongodb:\\/\\/.+\\/([^?&]+)/s', $dsn, $matches)) {
131+
if (preg_match('/^mongodb(?:[+]srv)?:\\/\\/.+\\/([^?&]+)/s', $dsn, $matches)) {
132132
$config['database'] = $matches[1];
133133
} else {
134134
throw new InvalidArgumentException("Database is not properly configured.");

0 commit comments

Comments
 (0)