@props(['context' => 'cart', 'appliedCode' => null, 'token' => null, 'tone' => 'light']) @php if ($context === 'checkout' && $token) { $applyRoute = route('checkout.discount.apply', $token); $removeRoute = route('checkout.discount.apply', $token); } else { $applyRoute = route('cart.discount.apply'); $removeRoute = route('cart.discount.remove'); } $dark = $tone === 'dark'; @endphp
merge(['class' => $dark ? 'rounded border border-white/12 bg-white/[0.03] p-4 text-sm text-white' : 'rounded border border-black/10 bg-white p-4 text-sm']) }}>
Discount code
@error('code')

{{ $message }}

@enderror @if($appliedCode)

Applied: {{ $appliedCode }}

@if($context === 'checkout')
@csrf
@else
@csrf
@endif @else
@csrf
@endif