|
8 | 8 | use Illuminate\Http\RedirectResponse; |
9 | 9 | use Illuminate\Http\Request; |
10 | 10 | use Illuminate\Validation\Rule; |
11 | | -use Illuminate\View\View; |
12 | 11 |
|
13 | 12 | class DeveloperOnboardingController extends Controller |
14 | 13 | { |
15 | 14 | public function __construct(protected StripeConnectService $stripeConnectService) {} |
16 | 15 |
|
17 | | - public function show(Request $request): View|RedirectResponse |
18 | | - { |
19 | | - $user = $request->user(); |
20 | | - $developerAccount = $user->developerAccount; |
21 | | - |
22 | | - if ($developerAccount && $developerAccount->hasCompletedOnboarding() && $developerAccount->hasAcceptedCurrentTerms()) { |
23 | | - return to_route('customer.developer.dashboard') |
24 | | - ->with('message', 'Your developer account is already set up.'); |
25 | | - } |
26 | | - |
27 | | - return view('customer.developer.onboarding', [ |
28 | | - 'developerAccount' => $developerAccount, |
29 | | - 'hasExistingAccount' => $developerAccount !== null, |
30 | | - ]); |
31 | | - } |
32 | | - |
33 | 16 | public function start(Request $request): RedirectResponse |
34 | 17 | { |
35 | 18 | $request->validate([ |
@@ -131,35 +114,4 @@ public function refresh(Request $request): RedirectResponse |
131 | 114 | ->with('error', 'Unable to refresh onboarding. Please try again.'); |
132 | 115 | } |
133 | 116 | } |
134 | | - |
135 | | - public function dashboard(Request $request): View|RedirectResponse |
136 | | - { |
137 | | - $user = $request->user(); |
138 | | - $developerAccount = $user->developerAccount; |
139 | | - |
140 | | - if (! $developerAccount || ! $developerAccount->hasCompletedOnboarding()) { |
141 | | - return to_route('customer.developer.onboarding'); |
142 | | - } |
143 | | - |
144 | | - $this->stripeConnectService->refreshAccountStatus($developerAccount); |
145 | | - |
146 | | - $plugins = $user->plugins()->withCount('licenses')->get(); |
147 | | - $payouts = $developerAccount->payouts()->with('pluginLicense.plugin')->latest()->limit(10)->get(); |
148 | | - |
149 | | - $totalEarnings = $developerAccount->payouts() |
150 | | - ->where('status', 'transferred') |
151 | | - ->sum('developer_amount'); |
152 | | - |
153 | | - $pendingEarnings = $developerAccount->payouts() |
154 | | - ->where('status', 'pending') |
155 | | - ->sum('developer_amount'); |
156 | | - |
157 | | - return view('customer.developer.dashboard', [ |
158 | | - 'developerAccount' => $developerAccount, |
159 | | - 'plugins' => $plugins, |
160 | | - 'payouts' => $payouts, |
161 | | - 'totalEarnings' => $totalEarnings, |
162 | | - 'pendingEarnings' => $pendingEarnings, |
163 | | - ]); |
164 | | - } |
165 | 117 | } |
0 commit comments