@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
{{-- Enhanced Study --}} @if ($product->enhanced_study == null) @else @if ($subscription && $subscription->level_id == 10) Continue to Enhanced Study @else @endif @endif {{-- End Enhanced Study --}} {{-- read book --}} @if ($product->read_ebook == null) {{-- update for Read Bible --}} @if ($product->id == 444) Read Bible @else @endif @else {{-- free E-Book --}} @if ($product->levels->contains('id', 7)) Read E-Book {{-- subscription and Access --}} @elseif ($subscription && $product->levels->contains('id', $subscription->level_id)) Read E-Book @else {{--No subscription and No Access --}} @endif @endif {{-- read book ends --}} {{-- Listen To Audio --}} {{-- @if ($product->audio->isEmpty()) --}} @if ($product->listen_audiobook == null) @else @if ($product->levels->contains('id', 7)) Listen to AudioBook @elseif ($subscription && $product->levels->contains('id', $subscription->level_id)) Listen to AudioBook @else @endif @endif {{-- Listen To Audio ends --}}

{{ $product->product_name }}

{{ $product->product_subtitle }}
{{ $product->short_description }}
Tags
@php $tags = explode(',', $product->product_tags); @endphp @foreach ($tags as $tag) {{ ucfirst($tag) }}   @endforeach
@if ((!$product->read_ebook && !$product->listen_audiobook) || $product->id == 449 ) @else
Access Level
@foreach ($product->levels as $level) {{ $level->level_name }} @if ($level->id != 7) Subscription @endif @if (!$loop->last)   @endif
@endforeach
@endif
{{-- subscription --}}
{{-- @if (!$product->cloud_code && !$product->flip_code) --}} @if (!$product->read_ebook && !$product->listen_audiobook && !$product->enhanced_study) {{-- free book --}} @elseif ($product->levels->contains('id', 7)) @else {{-- subscribed uers --}} @if ($subscription) {{-- modifcation for ISM --}} @if (auth()->user()->zone == 'ISM') You are a
{{ $subscription->subscription_name }} member
@else You are a
{{ $subscription->subscription_name }} member
@endif
{{-- unsubscribed users --}} @else {{-- subscribe to access enhanced study, read and listen --}} {{-- @if ($product->cloud_code && count($product->audio) > 0) --}} @if ($product->enhanced_study && $product->read_ebook && $product->listen_audiobook) {{-- modifcation for ISM --}} @if (auth()->user()->zone == 'ISM') Subscribe to Access Enhanced Study ,
Read E-Book and Listen to AudioBook
@else Subscribe to Access Enhanced Study,
Read E-Book and Listen to AudioBook
@endif
{{-- subscribe to read ebook and listen to audiobook --}} @elseif (!$product->enhanced_study && $product->read_ebook && $product->listen_audiobook) {{-- modifcation for ISM --}} @if (auth()->user()->zone == 'ISM') Subscribe to Read E-book
and Listen to AudioBook
@else Subscribe to Read E-book
and Listen to AudioBook
@endif
{{-- subscribe to access enhanced study and ebook --}} @elseif ($product->enhanced_study && $product->read_ebook && !$product->listen_audiobook) {{-- modifcation for ISM --}} @if (auth()->user()->zone == 'ISM') Subscribe to Access Enhanced Study
and Read E-Book
@else Subscribe to Access Enhanced Study
and Read E-Book
@endif
{{-- subscribe to access enhanced study and audiobook --}} @elseif ($product->enhanced_study && !$product->read_ebook && $product->listen_audiobook) {{-- modifcation for ISM --}} @if (auth()->user()->zone == 'ISM') Subscribe to Access Enhanced Study
and Listen to AudioBook
@else Subscribe to Access Enhanced Study
and Listen to AudioBook
@endif
{{-- subscribe to read ebook --}} {{-- @elseif ($product->cloud_code && $product->audio->isEmpty()) --}} @elseif (!$product->enhanced_study && $product->read_ebook && !$product->listen_audiobook) {{-- modifcation for ISM --}} @if (auth()->user()->zone == 'ISM') Subscribe to Read
E-Book
@else Subscribe to Read
E-Book
@endif
{{-- subscribe to listen to audiobook --}} {{-- @elseif ($product->cloud_code == null && count($product->audio) > 0) --}} @elseif (!$product->enhanced_study && !$product->read_ebook && $product->listen_audiobook) {{-- modifcation for ISM --}} @if (auth()->user()->zone == 'ISM') Subscribe to Listen To
AudioBook
@else Subscribe to Listen To
AudioBook
@endif
{{-- subscribe to Access Enhanced Study --}} @elseif ($product->enhanced_study && !$product->read_ebook && !$product->listen_audiobook) {{-- modifcation for ISM --}} @if (auth()->user()->zone == 'ISM') Subscribe to Access
Enhanced Study
@else Subscribe to Access
Enhanced Study
@endif
@else @endif @endif @endif
{{-- end subscribe to access enhanced study read and listen --}} {{-- purchase EBook --}} {{-- end Purchase EBook --}} {{-- Purchase Print Book --}}
@if ($product->available_in_print == null) @else @endif
{{-- End Purchase Print Book --}}

Book Description

{!! $product->long_description !!}

Recommended

@foreach ($relatedProducts as $related) @endforeach
@endsection