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
Copy file name to clipboardExpand all lines: src/app/Models/Traits/HasEnumFields.php
+7-1Lines changed: 7 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,13 @@ public static function getPossibleEnumValues($field_name)
20
20
21
21
$instance = newstatic(); // create an instance of the model to be able to get the table name
22
22
$connectionName = $instance->getConnectionName();
23
-
$type = DB::connection($connectionName)->select(DB::raw('SHOW COLUMNS FROM `'.$table_prefix.$instance->getTable().'` WHERE Field = "'.$field_name.'"'))[0]->Type;
23
+
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 - it only works on MySQL.');
0 commit comments