app/resources/views/billing/index.blade.php

107 lines
5.4 KiB
PHP
Raw Normal View History

2026-01-07 01:08:58 +01:00
<x-layouts.app>
2026-01-07 01:18:18 +01:00
<div class="px-4 sm:px-6 lg:px-8" x-data="{ showCancelModal: false }">
2026-01-07 01:08:58 +01:00
<div class="max-w-2xl mx-auto">
<h1 class="text-2xl font-syncopate text-accent-blue mb-8">BILLING</h1>
2026-01-07 01:18:18 +01:00
@if (session('success'))
<div class="mb-6 border-2 border-success rounded-lg p-4 bg-success/10">
<p class="text-success">{{ session('success') }}</p>
</div>
@endif
@if (session('error'))
<div class="mb-6 border-2 border-danger rounded-lg p-4 bg-danger/10">
<p class="text-danger">{{ session('error') }}</p>
</div>
@endif
2026-01-07 01:08:58 +01:00
<div class="border-2 border-secondary rounded-lg p-6">
<h3 class="text-xl font-bold text-primary mb-6">Subscription Details</h3>
<div class="space-y-4">
<div class="flex justify-between items-center border-b border-gray-600 pb-4">
<span class="text-gray-300">Plan</span>
<span class="text-white font-bold">{{ $planType }}</span>
</div>
<div class="flex justify-between items-center border-b border-gray-600 pb-4">
<span class="text-gray-300">Status</span>
<span class="font-bold {{ $subscription->stripe_status === 'active' ? 'text-success' : 'text-warning' }}">
{{ ucfirst($subscription->stripe_status) }}
</span>
</div>
@if($nextBillingDate)
<div class="flex justify-between items-center border-b border-gray-600 pb-4">
<span class="text-gray-300">Next billing date</span>
<span class="text-white">{{ $nextBillingDate->format('F j, Y') }}</span>
</div>
@endif
@if($subscription->ends_at)
<div class="flex justify-between items-center border-b border-gray-600 pb-4">
<span class="text-gray-300">Access until</span>
<span class="text-warning">{{ $subscription->ends_at->format('F j, Y') }}</span>
</div>
@endif
@if($planner->pm_last_four)
<div class="flex justify-between items-center pb-4">
<span class="text-gray-300">Payment method</span>
<span class="text-white">
<span class="text-gray-400">{{ ucfirst($planner->pm_type ?? 'Card') }}</span>
•••• {{ $planner->pm_last_four }}
2026-01-07 01:29:58 +01:00
<a href="{{ route('billing.portal') }}" class="ml-2 text-accent-blue hover:underline text-sm">Update</a>
2026-01-07 01:08:58 +01:00
</span>
</div>
@endif
</div>
2026-01-07 01:18:18 +01:00
@if(!$subscription->ends_at)
<div class="mt-6 pt-6 border-t border-gray-600">
<button @click="showCancelModal = true" class="text-danger hover:text-red-400 text-sm transition-colors">
Cancel subscription
</button>
</div>
@endif
</div>
</div>
<!-- Cancel Confirmation Modal -->
<div x-show="showCancelModal"
x-cloak
x-transition:enter="transition ease-out duration-200"
x-transition:enter-start="opacity-0"
x-transition:enter-end="opacity-100"
x-transition:leave="transition ease-in duration-150"
x-transition:leave-start="opacity-100"
x-transition:leave-end="opacity-0"
class="fixed inset-0 z-50 flex items-center justify-center bg-black/50">
<div @click.away="showCancelModal = false"
x-transition:enter="transition ease-out duration-200"
x-transition:enter-start="opacity-0 scale-95"
x-transition:enter-end="opacity-100 scale-100"
x-transition:leave="transition ease-in duration-150"
x-transition:leave-start="opacity-100 scale-100"
x-transition:leave-end="opacity-0 scale-95"
class="bg-gray-700 border-2 border-secondary rounded-lg p-6 max-w-md mx-4">
<h3 class="text-xl font-bold text-white mb-4">Cancel Subscription?</h3>
<p class="text-gray-300 mb-6">
Are you sure you want to cancel your subscription? You will retain access until the end of your current billing period.
</p>
<div class="flex justify-end space-x-4">
<button @click="showCancelModal = false" class="px-4 py-2 text-gray-300 hover:text-white transition-colors">
Keep subscription
</button>
<form action="{{ route('subscription.cancel') }}" method="POST">
@csrf
<button type="submit" class="px-4 py-2 bg-danger hover:bg-red-600 text-white rounded transition-colors">
Cancel subscription
</button>
</form>
</div>
2026-01-07 01:08:58 +01:00
</div>
</div>
</div>
</x-layouts.app>