<?php
function svg_icon($fa_icon_code, $checked = 0){
                $fa_icons = Cache::rememberForever('fa_icons', function () {
                Cache::increment('total_cached');
                return DB::table('fa_icons')->get();
            });
    
            foreach ($fa_icons as $icon) {
            $svg_icon[$icon->icon] = $icon->svg_code;
        }
        if (isset($svg_icon[$fa_icon_code])) {
    return $svg_icon[$fa_icon_code];
        }
};

 function getAbsoluteUrl($url)
    {

        $urlParts = parse_url($url);
        $baseParts = parse_url('https://play.google.com');
        $absoluteParts = array_merge($baseParts, $urlParts);

        $absoluteUrl = $absoluteParts['scheme'].'://'.$absoluteParts['host'];
        if (isset($absoluteParts['path'])) {
            $absoluteUrl .= $absoluteParts['path'];
        } else {
            $absoluteUrl .= '/';
        }
        if (isset($absoluteParts['query'])) {
            $absoluteUrl .= '?'.$absoluteParts['query'];
        }
        if (isset($absoluteParts['fragment'])) {
            $absoluteUrl .= '#'.$absoluteParts['fragment'];
        }

        return $absoluteUrl;
    }

