You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$instance = newstatic(); // create an instance of the model to be able to get the table name
22
-
$connection = $instance->getConnection();
22
+
$connectionName = $instance->getConnectionName();
23
23
24
-
// SQLite doesn't support enum
25
-
if ($connection->getConfig('driver') === 'sqlite') {
26
-
returnnull;
24
+
try {
25
+
$type = DB::connection($connectionName)->select(DB::raw('SHOW COLUMNS FROM `'.$table_prefix.$instance->getTable().'` WHERE Field = "'.$field_name.'"'))[0]->Type;
26
+
} catch (\Exception$e) {
27
+
abort(500, 'Enum field type is not supported.');
27
28
}
28
29
29
-
$type = $connection->select(DB::raw('SHOW COLUMNS FROM `'.$table_prefix.$instance->getTable().'` WHERE Field = "'.$field_name.'"'))[0]->Type;
0 commit comments