From 4b31f3d315fd2b0fe8cea6d1496e03bca5e73ed5 Mon Sep 17 00:00:00 2001 From: myrmidex Date: Wed, 7 Jan 2026 01:29:58 +0100 Subject: [PATCH] feature - 30 - Update payment method --- app/Http/Controllers/SubscriptionController.php | 5 +++++ resources/views/billing/index.blade.php | 1 + routes/web.php | 1 + 3 files changed, 7 insertions(+) diff --git a/app/Http/Controllers/SubscriptionController.php b/app/Http/Controllers/SubscriptionController.php index d84e561..24d0dc9 100644 --- a/app/Http/Controllers/SubscriptionController.php +++ b/app/Http/Controllers/SubscriptionController.php @@ -104,4 +104,9 @@ public function cancel(Request $request): RedirectResponse return back()->with('success', 'Subscription canceled. Access will continue until the end of your billing period.'); } + + public function billingPortal(Request $request) + { + return $request->user()->redirectToBillingPortal(route('billing')); + } } diff --git a/resources/views/billing/index.blade.php b/resources/views/billing/index.blade.php index cf811b7..00c8900 100644 --- a/resources/views/billing/index.blade.php +++ b/resources/views/billing/index.blade.php @@ -51,6 +51,7 @@ {{ ucfirst($planner->pm_type ?? 'Card') }} •••• {{ $planner->pm_last_four }} + Update @endif diff --git a/routes/web.php b/routes/web.php index 4f4e3f9..f23fbc5 100644 --- a/routes/web.php +++ b/routes/web.php @@ -45,5 +45,6 @@ })->name('users.index'); Route::get('/billing', [SubscriptionController::class, 'billing'])->name('billing')->middleware('saas'); + Route::get('/billing/portal', [SubscriptionController::class, 'billingPortal'])->name('billing.portal')->middleware('saas'); }); });