symbol; } if(app('general_setting')->currency_symbol != null){ return app('general_setting')->currency_symbol; }else { return '$ '; } } } if (!function_exists('array_keys_to_snake_case')) { // Convert camel case array keys to snake case array keys function array_keys_to_snake_case($arr) { return array_combine(array_map(function($key) { return strtolower(preg_replace('/(? $value) { $nkey = lcfirst(str_replace('_', '', ucwords($key, '_'))); if (is_array($value)) { $value = array_keys_to_camel_case($value); } $result[$nkey] = $value; } return $result; } } if (!function_exists('array_to_object')) { function array_to_object($arr) { if (!is_array($arr)) { return $arr; } $result = new \stdClass(); foreach ($arr as $key => $value) { $result->$key = array_to_object($value); } return $result; } } if (!function_exists('substr_text_only')) { function substr_text_only($string, $limit, $end='...') { $with_html_count = strlen($string); $without_html_count = strlen(strip_tags($string)); $html_tags_length = $with_html_count-$without_html_count; return Str::limit($string, $limit+$html_tags_length, $end); } }