File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -751,7 +751,7 @@ The belongsToMany relation will not use a pivot "table" but will push id's to a
751
751
If you want to define custom keys for your relation, set it to ` null ` :
752
752
753
753
``` php
754
- use Jenssegers\Mongodb\Eloquent\Mode ;
754
+ use Jenssegers\Mongodb\Eloquent\Model ;
755
755
756
756
class User extends Model
757
757
{
Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ public function getDatabaseName()
128
128
protected function getDefaultDatabaseName ($ dsn , $ config )
129
129
{
130
130
if (empty ($ config ['database ' ])) {
131
- if (preg_match ('/^mongodb: \\/ \\/.+ \\/([^?&]+)/s ' , $ dsn , $ matches )) {
131
+ if (preg_match ('/^mongodb(?:[+]srv)? : \\/ \\/.+ \\/([^?&]+)/s ' , $ dsn , $ matches )) {
132
132
$ config ['database ' ] = $ matches [1 ];
133
133
} else {
134
134
throw new InvalidArgumentException ("Database is not properly configured. " );
You can’t perform that action at this time.
0 commit comments