+ $attrs = array_merge([
+ 'class' => 'svg-icon',
+ 'data-icon' => $name,
+ 'role' => 'presentation',
+ ], $attrs);
+ $attrString = ' ';
+ foreach ($attrs as $attrName => $attr) {
+ $attrString .= $attrName . '="' . $attr . '" ';
+ }
+
+ $iconPath = resource_path('icons/' . $name . '.svg');
+ $themeIconPath = theme_path('icons/' . $name . '.svg');
+
+ if ($themeIconPath && file_exists($themeIconPath)) {
+ $iconPath = $themeIconPath;
+ } elseif (!file_exists($iconPath)) {
+ return '';