File tree Expand file tree Collapse file tree 2 files changed +2
-10
lines changed Expand file tree Collapse file tree 2 files changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ public function apply(array $settings = []): SettingsManagerContract
30
30
} else {
31
31
if (!$ modelSettings ) {
32
32
$ modelSettings = new ModelSettings ();
33
- $ modelSettings ->setConnection ($ this ->model ->getConnectionName ());
33
+ $ modelSettings ->setConnection ($ this ->model ->getConnectionName () ?? config ( ' database.default ' ) );
34
34
$ modelSettings ->model ()->associate ($ this ->model );
35
35
}
36
36
$ modelSettings ->settings = $ settings ;
Original file line number Diff line number Diff line change @@ -75,14 +75,6 @@ public function getSettingsFieldName(): string
75
75
return $ this ->settingsFieldName ?? config ('model_settings.settings_field_name ' );
76
76
}
77
77
78
- /**
79
- * @return string
80
- */
81
- public function getConnectionName (): string
82
- {
83
- return $ this ->connection ?? config ('database.default ' );
84
- }
85
-
86
78
/**
87
79
* @return bool
88
80
*/
@@ -109,7 +101,7 @@ private function hasSettingsField()
109
101
config ('model_settings.settings_table_cache_prefix ' ) . '::has_field ' ,
110
102
now ()->addDays (1 ),
111
103
function () {
112
- return Schema::connection ($ this ->getConnectionName ())
104
+ return Schema::connection ($ this ->getConnectionName () ?? config ( ' database.default ' ) )
113
105
->hasColumn (
114
106
$ this ->getTable (),
115
107
$ this ->getSettingsFieldName ()
You can’t perform that action at this time.
0 commit comments