original_string: public static function getTableEnumList(string $field, string $labelKey = null, string $translationCode = null)
      {
          $type = DB::select(
              DB::raw('SHOW COLUMNS FROM ' . self::getTableName() . ' WHERE Field = "' . $field . '"')
          )[0]->Type;
  
          preg_match('/^enum\((.*)\)$/', $type, $matches);
  
          $values = [];
  
          foreach (explode(',', $matches[1]) as $value) {
              $value = trim($value, "'");
  
              if (is_null($labelKey)) {
                  $values[] = $value;
              } else {
                  $values[] = [
                      'id'      => $value,
                      $labelKey => trans($translationCode . $value),
                  ];
              }
          }
  
          return $values;
      }
code: public static function getTableEnumList(string $field, string $labelKey = null, string $translationCode = null)
      {
          $type = DB::select(
              DB::raw('SHOW COLUMNS FROM ' . self::getTableName() . ' WHERE Field = "' . $field . '"')
          )[0]->Type;
  
          preg_match('/^enum\((.*)\)$/', $type, $matches);
  
          $values = [];
  
          foreach (explode(',', $matches[1]) as $value) {
              $value = trim($value, "'");
  
              if (is_null($labelKey)) {
                  $values[] = $value;
              } else {
                  $values[] = [
                      'id'      => $value,
                      $labelKey => trans($translationCode . $value),
                  ];
              }
          }
  
          return $values;
      }
code_tokens: public static function getTableEnumList ( string $ field , string $ labelKey = null , string $ translationCode = null ) { $ type = DB :: select ( DB :: raw ( 'SHOW COLUMNS FROM ' . self :: getTableName ( ) . ' WHERE Field = "' . $ field . '"' ) ) [ 0 ] -> Type ; preg_match ( '/^enum\((.*)\)$/' , $ type , $ matches ) ; $ values = [ ] ; foreach ( explode ( ',' , $ matches [ 1 ] ) as $ value ) { $ value = trim ( $ value , "'" ) ; if ( is_null ( $ labelKey ) ) { $ values [ ] = $ value ; } else { $ values [ ] = [ 'id' => $ value , $ labelKey => trans ( $ translationCode . $ value ) , ] ; } } return $ values ; }
docstring: Get table enum field list with translations or not
  
  @param string $field
  @param null|string $labelKey
  @param string $translationCode
  @return array
docstring_tokens: Get table enum field list with translations or not