@extends('admin.layout') @section('content')
Coupons
@if (count($coupons) == 0)

NO COUPON FOUND

@else
@foreach ($coupons as $coupon) @endforeach
Name Code Discount Status Created Actions
{{ $coupon->name }} {{ $coupon->code }} {{ $coupon->type == 'fixed' && $be->base_currency_symbol_position == 'left' ? $be->base_currency_symbol : '' }}{{ $coupon->value }}{{ $coupon->type == 'percentage' ? '%' : '' }}{{ $coupon->type == 'fixed' && $be->base_currency_symbol_position == 'right' ? $be->base_currency_symbol : '' }} @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() }} Edit
@csrf
@endif
@endsection