auth()->check() ? redirect()->route('give.dashboard') : redirect()->route('sso.connect'))->name('give.root'); Route::get('/login', [SsoLoginController::class, 'connect'])->name('login'); Route::get('/sso/connect', [SsoLoginController::class, 'connect'])->name('sso.connect'); Route::get('/sso/callback', [SsoLoginController::class, 'callback'])->name('sso.callback'); Route::post('/logout', [SsoLoginController::class, 'logout'])->name('logout'); Route::get('/sso/logout-bridge', [SsoLoginController::class, 'logoutBridge'])->name('sso.logout-bridge'); Route::get('/sso/logout-frontchannel', [SsoLoginController::class, 'frontchannelLogout'])->name('sso.logout-frontchannel'); Route::get('/signed-out', fn () => auth()->check() ? redirect()->route('give.dashboard') : view('give.signed-out'))->name('give.signed-out'); Route::get('/q/{shortCode}', [QrScanController::class, 'resolve'])->name('qr.public.resolve'); Route::get('/q/{shortCode}/church-logo', [QrScanController::class, 'churchLogo'])->name('qr.public.church.logo'); Route::get('/q/{shortCode}/church-cover', [QrScanController::class, 'churchCover'])->name('qr.public.church.cover'); Route::post('/q/{shortCode}/order', [DonationController::class, 'store'])->name('qr.public.order'); Route::get('/q/{shortCode}/order/callback', [DonationController::class, 'callback'])->name('qr.public.order.callback'); Route::middleware(['auth'])->group(function () { Route::get('/notifications', [NotificationController::class, 'index'])->name('notifications.index'); Route::get('/notifications/unread', [NotificationController::class, 'unread'])->name('notifications.unread'); Route::post('/notifications/{id}/read', [NotificationController::class, 'markAsRead'])->name('notifications.mark-read'); Route::post('/notifications/mark-all-read', [NotificationController::class, 'markAllAsRead'])->name('notifications.mark-all-read'); Route::get('/dashboard', [OverviewController::class, 'index'])->name('give.dashboard'); Route::get('/search', SearchController::class)->name('give.search'); Route::post('/afia/chat', [AfiaController::class, 'chat'])->name('give.afia.chat'); Route::get('/giving-pages', [GivingPageController::class, 'index'])->name('give.giving-pages.index'); Route::get('/giving-pages/create', [GivingPageController::class, 'create'])->name('give.giving-pages.create'); Route::post('/giving-pages', [GivingPageController::class, 'store'])->name('give.giving-pages.store'); Route::get('/giving-pages/{givingPage}', [GivingPageController::class, 'show'])->name('give.giving-pages.show'); Route::patch('/giving-pages/{givingPage}', [GivingPageController::class, 'update'])->name('give.giving-pages.update'); Route::delete('/giving-pages/{givingPage}', [GivingPageController::class, 'destroy'])->name('give.giving-pages.destroy'); Route::get('/giving-pages/{givingPage}/preview.png', [GivingPageController::class, 'preview'])->name('give.giving-pages.preview'); Route::get('/giving-pages/{givingPage}/download/{format}', [GivingPageController::class, 'download'])->name('give.giving-pages.download')->whereIn('format', ['png', 'svg', 'pdf']); Route::get('/donations', [DonationsController::class, 'index'])->name('give.donations.index'); Route::get('/payouts', [PayoutsController::class, 'index'])->name('give.payouts'); Route::get('/settings', [AccountController::class, 'settings'])->name('account.settings'); Route::put('/settings', [AccountController::class, 'updateSettings'])->name('account.settings.update'); Route::get('/team', [TeamController::class, 'index'])->name('account.team'); Route::post('/team', [TeamController::class, 'store'])->name('account.team.store'); Route::delete('/team/{member}', [TeamController::class, 'destroy'])->name('account.team.destroy'); Route::post('/switch-account', [TeamController::class, 'switchAccount'])->name('account.switch'); });