@extends('user.layout') @section('styles') @endsection @section('content')
{{ '#' }} | {{ __('Name') }} | {{ __('Code') }} | {{ __('Discount') }} | {{ __('Created') }} | {{ __('Status') }} | {{ __('Actions') }} |
---|---|---|---|---|---|---|
{{ $loop->iteration }} | {{ strlen($coupon->name) > 30 ? mb_substr($coupon->name, 0, 30, 'UTF-8') . '...' : $coupon->name }} | {{ $coupon->code }} | @if ($coupon->type == 'fixed') {{ $currencyInfo->base_currency_symbol_position == 'left' ? $currencyInfo->base_currency_symbol : '' }}{{ $coupon->value }}{{ $currencyInfo->base_currency_symbol_position == 'right' ? $currencyInfo->base_currency_symbol : '' }} @else {{ $coupon->value . '%' }} @endif | @php $createDate = $coupon->created_at; // first, get the difference of create-date & today-date $diff = $createDate->diffInDays($todayDate); @endphp {{-- then, get the human read-able value from those dates --}} {{ $createDate->subDays($diff)->diffForHumans() }} |
@if ($startDate->greaterThan($todayDate))
{{ __('Pending') }}@elseif ($todayDate->between($startDate, $endDate)){{ __('Active') }}@elseif ($endDate->lessThan($todayDate)){{ __('Expired') }}@endif |
{{ __('Edit') }} |