@php function hexToRgb($hex) { $hex = ltrim($hex, '#'); if (strlen($hex) == 3) { $hex = $hex[0] . $hex[0] . $hex[1] . $hex[1] . $hex[2] . $hex[2]; } $r = hexdec(substr($hex, 0, 2)); $g = hexdec(substr($hex, 2, 2)); $b = hexdec(substr($hex, 4, 2)); return "$r, $g, $b"; } @endphp
@foreach ($get_cat_with_coupon as $category)

{{ $category['name'] }}

{{ __('messages.show_all') }}
@if ($category['coupons']->isNotEmpty())
@foreach($category['coupons'] as $coupon)
@if ($coupon['is_new'] == 1) {{ __('messages.new') }} @endif @if ($coupon['is_featured'] == 1) {{ __('messages.featured') }} @endif @if ($coupon['discount_type'] == 'fixed') -{{ number_format($coupon['discount_value'], 0) }} @elseif ($coupon['discount_type'] == 'percentage') {{ number_format($coupon['discount_value'], 0) }}% @endif
{{ $coupon['name'] }}

{{ strip_tags($coupon['description']) }}

@endforeach
@else

{{ __('messages.no_coupons_available') }}

@endif
@endforeach