@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') }}

Welcome back, {{ explode(' ', $user->name)[0] }}

Here's an overview of your Tab Hider account.

{{-- ══════════════════════════════════ STAT CARDS ROW ══════════════════════════════════ --}}
{{-- Plan Status --}}

Plan

@if($activeSub)

{{ $activeSub->plan_type }}

Premium

@else

Free

No active plan

@endif
{{-- Total Spent --}}

Total Spent

${{ number_format($totalSpent, 2) }}

{{ $user->subscriptions->count() }} purchase{{ $user->subscriptions->count() == 1 ? '' : 's' }}

{{-- API Keys --}}

API Keys

{{ $totalKeys }}

{{ $activeKeys }} active

{{-- Next Billing --}}

Next Billing

@if($activeSub)

{{ $activeSub->expires_at->format('d M Y') }}

{{ $isExpired ? 'Expired' : humanTime($daysLeft) }}

@else

No active plan

@endif
{{-- ══════════════════════════════════ EXPIRING SOON URGENT WARNING BANNER ══════════════════════════════════ --}} @if($activeSub && $expiringSoon) @endif {{-- ══════════════════════════════════ MAIN GRID ══════════════════════════════════ --}}
{{-- ── LEFT COLUMN ── --}}
{{-- Profile Card --}}
@if($user->profile_picture && !str_starts_with($user->profile_picture, 'avt') && file_exists(public_path('assets/img/avatars/' . $user->profile_picture))) Profile @else
{{ strtoupper(substr($user->name ?: $user->email ?: 'U', 0, 1)) }}
@endif
{{ $user->name }}

{{ $user->email }}

Member since {{ $user->created_at->format('M Y') }}
@can('update_user_management') Edit Profile @endcan Manage API Keys
{{-- Subscription Progress Card --}} @if($activeSub)

Active Subscription

{{ $activeSub->plan_type }} Premium @if($isExpired) Expired @elseif($expiringSoon) Expiring Soon @else Active @endif
{{ $activeSub->starts_at->format('d M Y') }} {{ $activeSub->expires_at->format('d M Y') }}
{{-- Human readable countdown --}} @if(!$isExpired)
{{ humanTime($daysLeft) }}
@else
Subscription expired · Renew now →
@endif
Amount paid ${{ number_format($activeSub->amount, 2) }}
Order ID {{ Str::limit($activeSub->paypal_order_id, 16, '…') }}
@else {{-- No Subscription CTA --}}
🚀
Unlock Premium Access

Get your personal API key and enable full Tab Hider capabilities.

View Plans
@endif {{-- Quick Tips Card --}}

Quick Tips

1

Paste your API key into the Tab Hider extension settings to activate premium features.

2

Rotate your key anytime if you suspect it has been compromised.

3

Renew before expiry to avoid any interruption to your service.

View Full FAQ
{{-- ── RIGHT COLUMN ── --}}
{{-- Flash Messages --}} @if(session('success')) @endif @if(session('error')) @endif {{-- API Keys Summary --}} @if($user->apiKeys->isNotEmpty())
My API Keys

{{ $activeKeys }} of {{ $totalKeys }} active

Manage All →
@foreach($user->apiKeys as $key) @php $keySub = $key->subscription; $keyExpiry = $keySub ? $keySub->expires_at : null; $keyDaysLeft = $keyExpiry ? (int) now()->diffInDays($keyExpiry, false) : null; $keyExpired = $keyExpiry && now()->isAfter($keyExpiry); $keySoon = !$keyExpired && $keyDaysLeft !== null && $keyDaysLeft <= 7; @endphp
{{-- Key badge --}}
{{ $key->key }}
{{-- Meta row --}}
@if($keySub) {{ $keySub->plan_type }} Premium @endif @if($keyExpiry) Expires {{ $keyExpiry->format('d M Y') }} @endif
@if($keyExpired) Expired @elseif($key->status == 'active') Active @else Disabled @endif @if($keyDaysLeft !== null && !$keyExpired)
{{ humanTime($keyDaysLeft) }}
@endif
@endforeach
@endif {{-- Purchase History --}}
Purchase History

All your subscription transactions

@if($user->subscriptions->isEmpty()) Get a Plan @endif
@if($user->subscriptions->isEmpty()) {{-- Empty state --}}
🛒
No purchases yet

Choose a plan to generate your first API key and unlock premium features.

Browse Plans
@else
@foreach($user->subscriptions->sortByDesc('created_at') as $sub) @php $subDays = (int) now()->diffInDays($sub->expires_at, false); $subExpired = $sub->expires_at && now()->isAfter($sub->expires_at); $subSoon = !$subExpired && $sub->expires_at && $subDays <= 7; @endphp @endforeach @if($user->subscriptions->count() > 1) @endif
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) }}
@endif
{{-- RESOURCES STRIP --}}

Extension Features

See what Tab Hider can do

Upgrade Plan

View available subscriptions

Manage API Keys

View, rotate or disable your keys

@endsection