matchAll(self::SCAN_RE) ->map(function($match) { $tag = Cache::remember(self::CACHE_KEY . $match, 14400, function() use($match) { return self::whereShortcode(':' . $match . ':')->first(); }); if($tag) { $url = url('/storage/' . $tag->media_path); return [ 'shortcode' => $match, 'url' => $url, 'static_path' => $url, 'visible_in_picker' => $tag->disabled == false ]; } }) ->filter(function($tag) { return $tag && isset($tag['static_path']); }) ->values(); } }