@props(['icon', 'class' => '', 'id' => '', 'width' => '', 'height' => '', 'attrs' => "" ])
@if (file_exists(public_path("images/icons/svg/{$icon}.svg"))) @php $contents = file_get_contents(public_path("images/icons/svg/{$icon}.svg")); if($width != "") { $contents = preg_replace("/(\swidth=[\S]\d[\S]+)/i", " width='".$width."'", $contents); } if($height != "") { $contents = preg_replace("/(\sheight=[\S]\d[\S]+)/i", " height='".$height."'", $contents); } @endphp {!! $contents !!} @else NA @endif