File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ class SModel extends Model
2424 *
2525 * @var string
2626 */
27- protected $ connection = ' simba ' ;
27+ protected $ connection ;
2828
2929 /**
3030 * Indicates if the model should be timestamped.
@@ -82,6 +82,19 @@ class SModel extends Model
8282 */
8383 protected $ casts = [];
8484
85+ /**
86+ * Create a new Eloquent model instance.
87+ * Overwrites legacy constructor with connection setup.
88+ *
89+ * @param array $attributes
90+ * @return void
91+ */
92+ public function __construct (array $ attributes = [])
93+ {
94+ parent ::__construct ($ attributes );
95+ $ this ->connection = $ this ->getSimbaConnectionName ();
96+ }
97+
8598 /**
8699 * Get the table name.
87100 * Overwrites legacy table name handling.
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ trait HasSimbaConnection
2323 */
2424 public function getSimbaConnectionName (): string
2525 {
26- return Config::get ('database.simba_connection ' , 'simba ' );
26+ return Config::get ('simba.connection ' , 'sqlsrv ' );
2727 }
2828
2929 /**
You can’t perform that action at this time.
0 commit comments