-
-
Notifications
You must be signed in to change notification settings - Fork 108
Expand file tree
/
Copy pathdashboard.blade.php
More file actions
178 lines (164 loc) · 6.95 KB
/
dashboard.blade.php
File metadata and controls
178 lines (164 loc) · 6.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<div>
<div class="mb-6">
<flux:heading size="xl">Dashboard</flux:heading>
<flux:text>Welcome back, {{ auth()->user()->first_name ?? auth()->user()->name }}</flux:text>
</div>
{{-- Session Messages --}}
@if (session('success'))
<flux:callout variant="success" icon="check-circle" class="mb-6">
<flux:callout.text>{{ session('success') }}</flux:callout.text>
</flux:callout>
@endif
@if (session('message'))
<flux:callout variant="secondary" icon="information-circle" class="mb-6">
<flux:callout.text>{{ session('message') }}</flux:callout.text>
</flux:callout>
@endif
@if (session('error'))
<flux:callout variant="danger" icon="x-circle" class="mb-6">
<flux:callout.text>{{ session('error') }}</flux:callout.text>
</flux:callout>
@endif
{{-- Ultra Upsell Banner --}}
@if(!$this->hasUltraSubscription)
<div class="mb-6 rounded-lg border border-zinc-300 bg-gradient-to-r from-zinc-100 to-zinc-200 p-6 dark:border-zinc-600 dark:from-zinc-800 dark:to-zinc-900">
<div class="flex items-start">
<div class="shrink-0 text-zinc-700 dark:text-zinc-300">
<x-heroicon-s-bolt class="size-6" />
</div>
<div class="ml-4 flex-1">
<h3 class="font-medium text-zinc-900 dark:text-zinc-100">
Upgrade to NativePHP Ultra
</h3>
<p class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
Access all first-party plugins at no extra cost, premium support, team management, and more.
</p>
<div class="mt-4">
<a href="{{ route('pricing') }}" class="inline-flex items-center rounded-md border border-transparent bg-black px-4 py-2 text-sm font-medium text-white transition hover:bg-zinc-800 focus:outline-none focus:ring-2 focus:ring-zinc-500 focus:ring-offset-2 dark:bg-white dark:text-black dark:hover:bg-zinc-200">
Learn more
</a>
</div>
</div>
</div>
</div>
@endif
{{-- Banners --}}
<div class="mb-6 grid grid-cols-1 gap-6 lg:grid-cols-2">
@feature(App\Features\ShowPlugins::class)
@if(auth()->user()->shouldSeeFreePluginsOffer() && !$this->hasUltraSubscription)
<x-free-plugins-offer-banner :inline="true" />
@endif
@else
<x-discounts-banner :inline="true" />
@endfeature
</div>
{{-- Dashboard Cards --}}
<div class="grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3">
{{-- Licenses Card --}}
@if($this->licenseCount > 0)
<x-dashboard-card
title="Licenses"
:count="$this->licenseCount"
icon="key"
color="blue"
:href="route('customer.licenses.list')"
link-text="View licenses"
/>
@endif
{{-- EAP Status Card --}}
<x-dashboard-card
title="Early Access Program"
:value="$this->isEapCustomer ? 'Member' : 'Not a member'"
:badge="$this->isEapCustomer ? 'EAP' : null"
:badge-color="$this->isEapCustomer ? 'green' : 'gray'"
icon="star"
:color="$this->isEapCustomer ? 'yellow' : 'gray'"
:description="$this->isEapCustomer ? 'You purchased before June 2025' : null"
/>
{{-- Subscription Card --}}
@if($this->activeSubscription?->active())
<x-dashboard-card
title="Subscription"
:value="$this->subscriptionName"
badge="Active"
badge-color="green"
icon="credit-card"
color="green"
:href="route('customer.billing-portal')"
link-text="Manage subscription"
/>
@else
<x-dashboard-card
title="Subscription"
value="No active subscription"
icon="credit-card"
color="gray"
:href="$this->renewalLicenseKey ? route('license.renewal', $this->renewalLicenseKey) : route('pricing')"
:link-text="$this->renewalLicenseKey ? 'Renew license' : 'View plans'"
/>
@endif
{{-- Team Card --}}
@if($this->hasUltraSubscription)
@if($this->ownedTeam)
<x-dashboard-card
title="Team"
:value="$this->ownedTeam->name"
icon="user-group"
color="purple"
:href="route('customer.team.index')"
link-text="Manage members"
:description="$this->teamMemberCount === 1 ? '1 active member' : $this->teamMemberCount . ' active members'"
/>
@else
<x-dashboard-card
title="Team"
value="No team yet"
icon="user-group"
color="gray"
:href="route('customer.team.index')"
link-text="Create a team"
description="Invite up to {{ config('subscriptions.plans.max.included_seats') - 1 }} members to share Ultra benefits ({{ config('subscriptions.plans.max.included_seats') }} seats total)"
/>
@endif
@endif
{{-- Premium Plugins Card --}}
@feature(App\Features\ShowPlugins::class)
<x-dashboard-card
title="Premium Plugins"
:count="$this->pluginLicenseCount"
icon="puzzle-piece"
color="purple"
:href="route('customer.purchased-plugins.index')"
link-text="View plugins"
/>
{{-- Submit Plugin Card --}}
<x-dashboard-card
title="Plugin Marketplace"
icon="code-bracket"
color="indigo"
description="Submit a plugin to the NativePHP marketplace"
:href="route('customer.plugins.create')"
link-text="Submit a plugin"
/>
@endfeature
{{-- Connected Accounts Card --}}
<x-dashboard-card
title="Connected Accounts"
:value="$this->connectedAccountsCount . ' of 2'"
icon="link"
color="indigo"
:href="route('customer.integrations')"
link-text="Manage integrations"
:description="$this->connectedAccountsDescription"
/>
{{-- Purchase History Card --}}
<x-dashboard-card
title="Purchase History"
:count="$this->totalPurchases"
icon="receipt-refund"
color="gray"
:href="route('customer.purchase-history.index')"
link-text="View history"
/>
</div>
</div>