presseportale/routes/customer.php
Kevin Adametz 198be381d6 T12: Depublikations-Checkout mit Tombstone (config-gated)
Kunden koennen eigene veroeffentlichte PMs kostenpflichtig aus der
oeffentlichen Ansicht nehmen: Panel auf der PM-Detailseite (inkl.
T1neu-Unternehmer-Checkbox und Doppelausweis netto/brutto), Stripe-
Ad-hoc-Checkout wie Credit-Topups, Erfuellung im Webhook — die PM
wechselt auf archived + depublished_at, die oeffentliche URL zeigt
dauerhaft einen Tombstone (410 Gone, ohne Inhalte, mit ehrlichem
Drittarchive-Hinweis). Doppelbuchungs-Bremse pro PM; Status-Log mit
Quelle "depublication". Gate: ohne BILLING_DEPUBLICATION_PRICE_CENTS
bleibt der Weg deaktiviert und /melden zeigt die neutrale
Preisformulierung [EXTERN: Preis festlegen, O6].

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 09:46:25 +00:00

80 lines
4.4 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\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::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');
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);
});