protected function serializeArrayToAttributes($attributes, $forceArray = false)
    {
        if (!is_array($attributes)) {
            $attributes = [$attributes];
        }

        foreach ($attributes as &$attribute) {
            $attribute = str_replace(['ID'], ['Id'], $attribute);
            $attribute = '\'' . snake_case($attribute) . '\'';
        }

        return $forceArray || count($attributes) > 1 ? '[' . implode(', ', $attributes) . ']' : reset($attributes);
    }
protected function serializeArrayToAttributes($attributes, $forceArray = false)
    {
        if (!is_array($attributes)) {
            $attributes = [$attributes];
        }

        foreach ($attributes as &$attribute) {
            $attribute = str_replace(['ID'], ['Id'], $attribute);
            $attribute = '\'' . snake_case($attribute) . '\'';
        }

        return $forceArray || count($attributes) > 1 ? '[' . implode(', ', $attributes) . ']' : reset($attributes);
    }
protected function serializeArrayToAttributes ( $ attributes , $ forceArray = false ) { if ( ! is_array ( $ attributes ) ) { $ attributes = [ $ attributes ] ; } foreach ( $ attributes as & $ attribute ) { $ attribute = str_replace ( [ 'ID' ] , [ 'Id' ] , $ attribute ) ; $ attribute = '\'' . snake_case ( $ attribute ) . '\'' ; } return $ forceArray || count ( $ attributes ) > 1 ? '[' . implode ( ', ' , $ attributes ) . ']' : reset ( $ attributes ) ; }
If array contains only one element return exported array value otherwise return serialized array of elements

All elements will snake cased

@param array|string $attributes column name
@param bool         $forceArray force array form even if array contains single value

@return array|string
If array contains only one element return exported array value otherwise return serialized array of elements