@props([ 'variant' => 'primary', 'icon' => null, ]) @php $classes = 'badge'; $classes .= match($variant) { 'primary' => ' badge-primary', 'secondary' => ' badge-secondary', 'success' => ' badge-success', 'warning' => ' badge-warning', 'danger' => ' badge-danger', 'info' => ' badge-info', default => ' badge-primary', }; $classes .= ' ' . ($attributes->get('class') ?? ''); @endphp merge(['class' => $classes]) }}> @if($icon) @endif {{ $slot }}