@extends('layouts.landing') @section('title') Transactions @endsection @section('content')
{{number_format($transaction_count)}} transactions
|
s/n | Name | Payment Reference | Payment Type | Amount | Package | Payment Status | Payment Date | {{--Package Status | --}}Package Expiry Date | Action | |
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
{{$transaction_no}} | @php $transaction_no++ @endphp{{$transaction->name}} | {{$transaction->email}} | {{$transaction->reference}} | {{$transaction->payment_type}} | ₦{{number_format($transaction->amount, 2)}} | {{$transaction->package}} | {{$transaction->status}} | {{\Carbon\Carbon::parse($transaction->created_at)->toFormattedDateString()}} | @php $package_expiry = App\Models\Package::where('id', $transaction->package_id)->first(); if($package_expiry){ if($package_expiry->validity == 'Days'){ $date = $package_expiry->duration; $transaction_date = \Carbon\Carbon::parse($transaction->created_at)->toFormattedDateString(); $get_date = strtotime($transaction_date); $added_date = strtotime("+$date day", $get_date); $expiry_date = date('M d, Y', $added_date); } if($package_expiry->validity == 'Months'){ $date = $package_expiry->duration; $transaction_date = \Carbon\Carbon::parse($transaction->created_at)->toFormattedDateString(); $get_date = strtotime($transaction_date); $added_date = strtotime("+$date month", $get_date); $expiry_date = date('M d, Y', $added_date); } if($package_expiry->validity == 'Years'){ $date = $package_expiry->duration; $transaction_date = \Carbon\Carbon::parse($transaction->created_at)->toFormattedDateString(); $get_date = strtotime($transaction_date); $added_date = strtotime("+$date year", $get_date); $expiry_date = date('M d, Y', $added_date); } } @endphp @if($transaction->status == 'paid'){{@$expiry_date}} | @else-- | @endif