@extends('layouts.frontend') @section('content')
@include('frontend.user.include.sidebar')

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

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

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


@if(count($vouchers)) @foreach ($vouchers as $voucher) @php $isExpired = $voucher->isExpired(); $isApplied = $voucher->isAppliedByUser($userId); $isApplicable = $voucher->isApplicableForUser($userId); @endphp @if ($isApplicable)

{{ $voucher->name }}

{{ __('messages.coupon_code') }} {{ $voucher->code }} Copy @if(!empty($voucher->applied_to))

{{ __('messages.applied_to') }} {{ implode(', ', $voucher->applied_product_names) }}

@else

{{ __('messages.applied_to') }} {{ __('messages.all_products') }}

@endif {{__('messages.copied')}}!
@if ($isApplied)
{{ __('messages.applied') }}
@elseif ($isExpired)
{{ __('messages.expired') }}
@else
{{ __('messages.valid_until') }} {{ \Carbon\Carbon::parse($voucher->expiration_date)->format('d F Y') }}
@endif
@endif @endforeach @else

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

@endif
@endsection