2025-03-31 23:49:32 +03:00
|
|
|
@extends('layouts.app')
|
2025-03-30 22:52:35 +03:00
|
|
|
|
2025-03-31 23:49:32 +03:00
|
|
|
@section('content')
|
|
|
|
|
<div class="container py-5">
|
|
|
|
|
<div class="row justify-content-center">
|
|
|
|
|
<div class="col-lg-10">
|
|
|
|
|
<div class="text-center mb-5">
|
|
|
|
|
<h1 class="h2 mb-3">Choose Your Subscription Plan</h1>
|
|
|
|
|
<p class="text-muted">Select the plan that best fits your needs</p>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
@if(session('success'))
|
|
|
|
|
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
|
|
|
|
{{ session('success') }}
|
|
|
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
2025-03-30 22:52:35 +03:00
|
|
|
</div>
|
2025-03-31 23:49:32 +03:00
|
|
|
@endif
|
|
|
|
|
|
|
|
|
|
@if(session('error'))
|
|
|
|
|
<div class="alert alert-danger alert-dismissible fade show" role="alert">
|
|
|
|
|
{{ session('error') }}
|
|
|
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
|
|
|
|
</div>
|
|
|
|
|
@endif
|
|
|
|
|
|
|
|
|
|
@if($userSubscription)
|
|
|
|
|
<div class="card mb-4">
|
|
|
|
|
<div class="card-body">
|
|
|
|
|
<div class="d-flex justify-content-between align-items-center">
|
|
|
|
|
<div>
|
|
|
|
|
<h5 class="card-title mb-1">Current Subscription: {{ $userSubscription->subscription->name }}</h5>
|
|
|
|
|
<p class="card-text text-muted mb-0">
|
|
|
|
|
Expires: {{ $userSubscription->expires_at->format('F j, Y') }}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<form action="{{ route('subscriptions.cancel', $userSubscription) }}" method="POST" class="d-inline">
|
|
|
|
|
@csrf
|
|
|
|
|
@method('DELETE')
|
|
|
|
|
<button type="submit" class="btn btn-outline-danger" onclick="return confirm('Are you sure you want to cancel your subscription?')">
|
|
|
|
|
Cancel Subscription
|
|
|
|
|
</button>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
@endif
|
|
|
|
|
|
|
|
|
|
<div class="row g-4">
|
|
|
|
|
@foreach($subscriptions as $subscription)
|
|
|
|
|
<div class="col-md-4">
|
|
|
|
|
<div class="card h-100 {{ $subscription->name === 'Pro' ? 'border-primary' : '' }}">
|
|
|
|
|
@if($subscription->name === 'Pro')
|
|
|
|
|
<div class="card-header bg-primary text-white text-center">
|
|
|
|
|
<span class="badge bg-white text-primary">Most Popular</span>
|
|
|
|
|
</div>
|
|
|
|
|
@endif
|
|
|
|
|
<div class="card-body">
|
|
|
|
|
<h3 class="card-title text-center mb-4">{{ $subscription->name }}</h3>
|
|
|
|
|
<div class="text-center mb-4">
|
|
|
|
|
<span class="display-4">${{ number_format($subscription->price, 2) }}</span>
|
|
|
|
|
<span class="text-muted">/month</span>
|
|
|
|
|
</div>
|
|
|
|
|
<p class="card-text text-center mb-4">{{ $subscription->description }}</p>
|
|
|
|
|
<ul class="list-unstyled mb-4">
|
|
|
|
|
@foreach($subscription->features as $feature)
|
|
|
|
|
<li class="mb-2">
|
|
|
|
|
<i class="bi bi-check-circle-fill text-success me-2"></i>
|
|
|
|
|
{{ $feature }}
|
|
|
|
|
</li>
|
|
|
|
|
@endforeach
|
|
|
|
|
</ul>
|
|
|
|
|
<div class="text-center">
|
|
|
|
|
@if($userSubscription && $userSubscription->subscription_id === $subscription->id)
|
|
|
|
|
<button class="btn btn-outline-primary" disabled>Current Plan</button>
|
|
|
|
|
@else
|
|
|
|
|
<form action="{{ route('subscriptions.subscribe', $subscription) }}" method="POST">
|
|
|
|
|
@csrf
|
|
|
|
|
<button type="submit" class="btn btn-primary">
|
|
|
|
|
Subscribe Now
|
|
|
|
|
</button>
|
|
|
|
|
</form>
|
|
|
|
|
@endif
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
@endforeach
|
2025-03-30 22:52:35 +03:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-03-31 23:49:32 +03:00
|
|
|
</div>
|
|
|
|
|
@endsection
|