@extends('user.user_dashboard')
@section('home')
@php
$id = Auth::user()->id;
$profileData = App\Models\User::find($id);
// Get the latest active subscription if it exists
$subscription = $profileData
->subscriptions()
->where('status', 'active')
->where('end_date', '>', now())
->latest()
->first();
$today = now();
$purchase = $profileData
->purchases()
->where('status', 'active')
->where('product_id', $product->id) // Assuming purchases have a product_id column
->first();
@endphp
{{ $product->product_name }}
{{ $product->product_subtitle }}
Tags
@php
$tags = explode(',', $product->product_tags);
@endphp
@foreach ($tags as $tag)
{{ ucfirst($tag) }}
@endforeach
Access Level
@foreach ($product->levels as $level)
{{ $level->level_name }}
@if ($level->id != 7)
Subscription
@endif
@if (!$loop->last)
@endif
@endforeach
@else
{{-- subscribed uers --}}
@if ($subscription)
You have an active Subscription
{{-- unsubscribed users --}}
@else
{{-- subscribe to Access Enhanced Study --}}
@if ($product->enhanced_study)
Subscribe to Access
Enhanced Study
@endif
@endif
@endif
{{ $product->discount_price_esp ? $product->discount_price_esp : $product->selling_price_esp }}
Espees |
{{ $product->discount_price_usd ? $product->discount_price_usd : $product->selling_price_usd }}
USD
@endif
@endif