File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -15,12 +15,12 @@ trait HasEnumFields
1515{
1616 public static function getPossibleEnumValues ($ field_name )
1717 {
18- $ default_connection = Config::get ('database.default ' );
19- $ table_prefix = Config::get ('database.connections. ' .$ default_connection .'.prefix ' );
20-
2118 $ instance = new static (); // create an instance of the model to be able to get the table name
22- $ connectionName = $ instance ->getConnectionName ();
23- $ connection = DB ::connection ($ connectionName );
19+
20+ $ connection = $ instance ->getConnection ();
21+
22+ $ table_prefix = Config::get ('database.connections. ' .$ connection ->getName ().'.prefix ' );
23+
2424 try {
2525 $ select = app ()->version () < 10 ?
2626 DB ::raw ('SHOW COLUMNS FROM ` ' .$ table_prefix .$ instance ->getTable ().'` WHERE Field = " ' .$ field_name .'" ' ) :
You can’t perform that action at this time.
0 commit comments