@extends('layouts.user') @section('content') @php $user = auth()->user(); $activeSub = $user->subscriptions->where('status', 'active')->sortByDesc('expires_at')->first(); $totalSpent = $user->subscriptions->sum('amount'); $totalKeys = $user->apiKeys->count(); $activeKeys = $user->apiKeys->where('status', 'active')->count(); /* ── Subscription time helpers ── */ $daysLeft = null; $isExpired = false; $expiringSoon = false; $progressPct = 0; if ($activeSub) { $daysLeft = (int) now()->diffInDays($activeSub->expires_at, false); $isExpired = now()->isAfter($activeSub->expires_at); $expiringSoon = !$isExpired && $daysLeft <= 7; if ($activeSub->starts_at && $activeSub->expires_at) { $total = max(1, $activeSub->starts_at->diffInDays($activeSub->expires_at)); $elapsed = $activeSub->starts_at->diffInDays(now()); $progressPct = min(100, round(($elapsed / $total) * 100)); } } /* ── Human-readable time helper ── */ function humanTime(int $days): string { if ($days <= 0) return 'Expired'; if ($days === 1) return '1 day left'; if ($days < 7) return $days . ' days left'; if ($days < 14) return '1 week left'; if ($days < 30) return round($days / 7) . ' weeks left'; if ($days < 60) return '1 month left'; if ($days < 365) return round($days / 30) . ' months left'; return round($days / 365, 1) . ' years left'; } @endphp {{-- PAGE HEADER --}}
{{ now()->format('l, d F Y') }}
Here's an overview of your Tab Hider account.
Plan
@if($activeSub){{ $activeSub->plan_type }}
Premium
@elseFree
No active plan
@endifTotal Spent
${{ number_format($totalSpent, 2) }}
{{ $user->subscriptions->count() }} purchase{{ $user->subscriptions->count() == 1 ? '' : 's' }}
API Keys
{{ $totalKeys }}
{{ $activeKeys }} active
Next Billing
@if($activeSub){{ $activeSub->expires_at->format('d M Y') }}
{{ $isExpired ? 'Expired' : humanTime($daysLeft) }}
@else—
No active plan
@endifYour key will expire in {{ humanTime($daysLeft) }} on {{ $activeSub->expires_at->format('d M Y') }}. Please renew to ensure uninterrupted panic-defense protection.
{{ $user->email }}
Member since {{ $user->created_at->format('M Y') }}Active Subscription
Get your personal API key and enable full Tab Hider capabilities.
View PlansQuick Tips
Paste your API key into the Tab Hider extension settings to activate premium features.
Rotate your key anytime if you suspect it has been compromised.
Renew before expiry to avoid any interruption to your service.
{{ $activeKeys }} of {{ $totalKeys }} active
{{ $key->key }}
All your subscription transactions
Choose a plan to generate your first API key and unlock premium features.
Browse Plans| Plan | Status | Start | Expires | Time Left | Paid |
|---|---|---|---|---|---|
|
{{ $sub->plan_type }} Premium
{{ Str::limit($sub->paypal_order_id, 18, '…') }}
|
@if($subExpired) Expired @else {{ ucfirst($sub->status) }} @endif | {{ $sub->starts_at ? $sub->starts_at->format('d M Y') : '—' }} | @if($sub->expires_at) {{ $sub->expires_at->format('d M Y') }} @else — @endif | @if($sub->expires_at) @if($subExpired) Expired @elseif($subSoon) {{ humanTime($subDays) }} @else {{ humanTime($subDays) }} @endif @else — @endif | ${{ number_format($sub->amount, 2) }} |
| {{ $user->subscriptions->count() }} transactions total | ${{ number_format($totalSpent, 2) }} | ||||