@extends('user.layout') @section('content')
{{ __('Coupons') }}
@if (count($coupons) == 0)

{{ __('NO COUPON FOUND') }}

@else
@foreach ($coupons as $coupon) @endforeach
{{ __('SL') }} {{ __('Name') }} {{ __('Code') }} {{ __('Discount') }} {{ __('Status') }} {{ __('Created') }} {{ __('Actions') }}
{{ $loop->iteration }} {{ $coupon->name }} {{ $coupon->code }} {{ $coupon->type == 'fixed' && $default_currency->symbol_position == 'left' ? $default_currency->symbol : '' }}{{ $coupon->value }}{{ $coupon->type == 'percentage' ? '%' : '' }} {{ $coupon->type == 'fixed' && $be->currency_position == 'right' ? $be->sign : '' }} @php $end = Carbon\Carbon::parse($coupon->end_date); $start = Carbon\Carbon::parse($coupon->start_date); $now = Carbon\Carbon::now(); $diff = $end->diffInDays($now); @endphp @if ($start->greaterThan($now))

{{ __('Pending') }}

@else @if ($now->lessThan($end))

{{ __('Active') }}

@else

{{ __('Expired') }}

@endif @endif
@php $created = Carbon\Carbon::parse($coupon->created_at); $diff = $created->diffInDays($now); @endphp {{ $created->subDays($diff)->diffForHumans() }}
@csrf
@endif
@include('user.item.order.coupons.edit') @endsection