@foreach($packages as $package)
@php
// Check if this package is the user's current active subscription
$isActiveSubscription = false;
if(auth()->check()) {
$activeSubscription = \App\Models\Subscription::where('user_id', auth()->id())
->where('plan_id', $package->id)
->where('status', 'active')
->first();
$isActiveSubscription = $activeSubscription ? true : false;
}
@endphp
@if($package->billing_cycle == 'monthly')
{{ $package->name }}
{{ $package->about }}
AUD {{ $package->price }} / Month
@foreach(explode('- ', strip_tags(htmlspecialchars_decode($package->features), '
- ')) as $feature)
@php
$clean_feature = trim(str_replace(['</li>', ' ', '\\r', '\\n', '\\t', '
- ', '
', '"'], '', $feature));
@endphp
@if(!empty($clean_feature))
- {{ $clean_feature }}
@endif
@endforeach
@if($isActiveSubscription)
@else
@if(auth()->user() && auth()->user()->hasRole('broker'))
@endif
@endif
@endif
@endforeach
@foreach($packages as $package)
@php
$isActiveSubscription = false;
if(auth()->check()) {
$activeSubscription = \App\Models\Subscription::where('user_id', auth()->id())
->where('plan_id', $package->id)
->where('status', 'active')
->first();
$isActiveSubscription = $activeSubscription ? true : false;
}
@endphp
@if($package->billing_cycle == 'yearly')
{{ $package->name }}
{{ $package->about }}
AUD {{ $package->price }} / Year
@foreach(explode('- ', strip_tags(htmlspecialchars_decode($package->features), '
- ')) as $feature)
@php
$clean_feature = trim(str_replace(['</li>', ' ', '\\r', '\\n', '\\t', '
- ', '
', '"'], '', $feature));
@endphp
@if(!empty($clean_feature))
- {{ $clean_feature }}
@endif
@endforeach
@if($isActiveSubscription)
@else
@if(auth()->user() && auth()->user()->hasRole('broker'))
@endif
@endif
@endif
@endforeach