presseportale/routes/customer.php
Kevin Adametz b3780e0fea Tarifwechsel im Buchungs-Modal: Abo-Swap mit anteiliger Verrechnung
Tarif-Karten bieten bei bestehendem Abo jetzt 'Zu diesem Tarif
wechseln' (pro Intervall, aktueller Tarif deaktiviert). Der Wechsel
laeuft ueber das bekannte Bestaetigungs-Modal (T1neu-Checkbox) als
POST auf die neue checkout.swap-Route: Cashier swapAndInvoice stellt
sofort um, verrechnet anteilig und hebt eine vorgemerkte Kuendigung
auf. SCA-Faelle leiten auf die Cashier-Bezahlseite. QA-Befund 07.07.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 12:58:32 +00:00

85 lines
4.8 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
use App\Http\Controllers\CheckoutController;
use App\Http\Controllers\LegacyInvoicePdfController;
use App\Http\Controllers\ProofPdfController;
use App\Http\Controllers\StripeInvoiceRedirectController;
use App\Http\Middleware\EnsureUserIsCustomer;
use App\Http\Middleware\LogSlowAdminRequests;
use Illuminate\Support\Facades\Route;
use Livewire\Volt\Volt;
// ============================================================
// "Mein Bereich" – Eigentümer-Sicht im gemeinsamen Admin-Panel
// URL-Prefix: /admin/me/*
// Routen-Name: me.*
// Zugriff: Rollen admin, editor, customer (alle eingeloggten Panel-User)
// ============================================================
Route::middleware(['auth', 'verified', EnsureUserIsCustomer::class, LogSlowAdminRequests::class])
->prefix('admin/me')
->name('me.')
->group(function () {
Volt::route('/', 'customer.dashboard')->name('dashboard');
Volt::route('press-releases', 'customer.press-releases.index')->name('press-releases.index');
Volt::route('press-releases/create', 'customer.press-releases.create')->name('press-releases.create');
Volt::route('press-releases/{id}', 'customer.press-releases.show')->name('press-releases.show');
Volt::route('press-releases/{id}/edit', 'customer.press-releases.edit')->name('press-releases.edit');
Route::get('press-releases/{id}/nachweis', ProofPdfController::class)
->where('id', '[0-9]+')
->name('press-releases.proof');
Volt::route('firmen', 'customer.press-kits.index')->name('press-kits.index');
Volt::route('firmen/anlegen', 'customer.press-kits.create')->name('press-kits.create');
Volt::route('firmen/{id}', 'customer.press-kits.show')->name('press-kits.show');
Route::redirect('pressemappen', '/admin/me/firmen', 301);
Route::get('pressemappen/{id}', fn (string $id) => redirect("/admin/me/firmen/{$id}", 301))
->where('id', '[0-9]+');
Volt::route('buchungen-add-ons', 'customer.bookings')->name('bookings.index');
Route::get('checkout/abo/{planSlug}/{interval}', [CheckoutController::class, 'subscription'])
->whereIn('interval', ['monthly', 'yearly'])
->name('checkout.subscription');
Route::post('checkout/tarifwechsel/{planSlug}/{interval}', [CheckoutController::class, 'swap'])
->whereIn('interval', ['monthly', 'yearly'])
->name('checkout.swap');
Route::get('checkout/einzel-pm', [CheckoutController::class, 'singlePm'])
->name('checkout.single-pm');
Route::get('checkout/credits/{pack}', [CheckoutController::class, 'creditTopup'])
->name('checkout.credit-topup');
Route::get('checkout/depublikation/{pressReleaseId}', [CheckoutController::class, 'depublication'])
->where('pressReleaseId', '[0-9]+')
->name('checkout.depublication');
Route::get('checkout/abo-verwalten', [CheckoutController::class, 'billingPortal'])
->name('checkout.billing-portal');
Volt::route('invoices', 'customer.invoices')->name('invoices.index');
Route::get('legacy-invoices/{legacyInvoice}/pdf', LegacyInvoicePdfController::class)->name('invoices.pdf');
Route::get('invoices/{invoice}/stripe', StripeInvoiceRedirectController::class)->name('invoices.stripe');
Volt::route('tokens', 'customer.tokens')->name('tokens.index');
Volt::route('profile', 'customer.profile')->name('profile');
Volt::route('security', 'customer.security')->name('security');
});
// ============================================================
// Legacy /customer/*-Pfade als 301-Redirect erhalten,
// damit Bookmarks und alte Mails weiter funktionieren.
// ============================================================
Route::prefix('customer')->group(function () {
Route::redirect('/', '/admin/me', 301);
Route::redirect('press-releases', '/admin/me/press-releases', 301);
Route::redirect('press-releases/create', '/admin/me/press-releases/create', 301);
Route::get('press-releases/{id}', fn (string $id) => redirect("/admin/me/press-releases/{$id}", 301))
->where('id', '[0-9]+');
Route::get('press-releases/{id}/edit', fn (string $id) => redirect("/admin/me/press-releases/{$id}/edit", 301))
->where('id', '[0-9]+');
Route::redirect('pressemappen', '/admin/me/firmen', 301);
Route::get('pressemappen/{id}', fn (string $id) => redirect("/admin/me/firmen/{$id}", 301))
->where('id', '[0-9]+');
Route::redirect('buchungen-add-ons', '/admin/me/buchungen-add-ons', 301);
Route::redirect('invoices', '/admin/me/invoices', 301);
Route::redirect('tokens', '/admin/me/tokens', 301);
Route::redirect('profile', '/admin/me/profile', 301);
Route::redirect('security', '/admin/me/security', 301);
});