improve code

This commit is contained in:
Mekan1206
2026-05-19 20:11:21 +05:00
parent 77fab714a6
commit a40eee7171
22 changed files with 1040 additions and 131 deletions

View File

@@ -0,0 +1,16 @@
@props(['name', 'class' => ''])
@php
$path = public_path("icons/{$name}.svg");
if (! is_file($path)) {
throw new InvalidArgumentException("Icon [{$name}] not found.");
}
$svg = file_get_contents($path);
$svg = preg_replace('/<svg\b/', '<svg class="w-full h-full"', $svg, 1);
@endphp
<span {{ $attributes->merge(['class' => 'inline-flex shrink-0 '.$class]) }} aria-hidden="true">
{!! $svg !!}
</span>