@extends('layouts.landing') @section('title', 'Subscription') @section('content')
@include('elements.settings-menu')
Subscription
@if ($user->subscribedUser())

Subscribed Plan: Active

{{ @$package->name }}
Upgrade Plan

Your subscription is active Expires on {{ \Carbon\Carbon::parse($user->expiry_date)->toFormattedDateString() }}

@elseif($user->pendingUser())

Subscribed Plan: Inactive

{{ @$package->name }}

Your subscription has not been activated

@elseif($user->expiredUser())

Subscribed Plan: Expired

{{ @$package->name }}

Your subscription has expired, on {{ \Carbon\Carbon::parse(Auth::user()->expiry_date)->toFormattedDateString() }}

Renew plan
@else

No active Plan

You don't have an active plan

Subscribe to a plan
@endif
@php $transaction_no = 1; @endphp @if ($transactions) @foreach ($transactions as $transaction) @php $transaction_no++; @endphp @php $package = App\Models\Package::where('id', $transaction->payment_reference_id)->first(); $donation = App\Models\Donation::where('id', $transaction->payment_reference_id)->first(); @endphp @php $package_expiry = App\Models\Package::where('id', $transaction->payment_reference_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') @else @endif @endforeach @else
No recent transaction
@endif
s/n Payment Reference Amount Package Payment Status Payment Date Package Expiry Date
{{ $transaction_no }}{{ $transaction->reference }} ₦{{ number_format($transaction->amount, 2) }} @if ($transaction->payment_type == 'subscription') {{ $package->name }} @else {{ $donation->title }} @endif {{ $transaction->status }} {{ \Carbon\Carbon::parse($transaction->created_at)->toFormattedDateString() }} @if ($transaction->payment_type == 'subscription') {{ @$expiry_date }} @else -- @endif --
@endsection