@props([
'type' => 'submit',
'style' => 'primary', // Bootstrap style: primary, secondary, etc.
'size' => null, // sm, lg
'block' => false, // full-width button
'outline' => false, // outline style
'icon' => null, // optional icon class
'loading' => false, // show a spinner
'disabled' => false, // disable button
'href' => null, // turn into link
'confirm' => null, // JS confirm text
])
@php
$btnClass = 'btn';
$btnClass .= $outline ? " btn-outline-$style" : " btn-$style";
$btnClass .= $size ? " btn-$size" : '';
$btnClass .= $block ? ' w-100' : '';
@endphp
@if ($href)
merge([
'class' => $btnClass,
'onclick' => $confirm ? "return confirm('$confirm')" : null
]) }}>
@if($icon)
@endif
{{ $slot }}
@else
@endif