@props(['name' => 'add', 'size' => false]) @php $attrs = $attributes->merge([ 'class' => 'svg-icon', 'data-icon' => $name ]); if($size) { $attrs['style'] = "width:$size;height:$size;" . $attrs['style']; } $attrString = ' '; foreach ($attrs as $attrName => $attr) $attrString .= $attrName . '="' . $attr . '" '; $iconPath = public_path('icons/' . $name . '.svg'); try { $fileContents = file_get_contents($iconPath); // Remove XML tag $fileContents = preg_replace('/<\?xml.+\?>/', '', $fileContents); $icon = str_replace('