feature - 30 - Update payment method

This commit is contained in:
myrmidex 2026-01-07 01:29:58 +01:00
parent 592a402d23
commit 4b31f3d315
3 changed files with 7 additions and 0 deletions

View file

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

View file

@ -51,6 +51,7 @@
<span class="text-white">
<span class="text-gray-400">{{ ucfirst($planner->pm_type ?? 'Card') }}</span>
•••• {{ $planner->pm_last_four }}
<a href="{{ route('billing.portal') }}" class="ml-2 text-accent-blue hover:underline text-sm">Update</a>
</span>
</div>
@endif

View file

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