neuer checkout-pfad: /de/bestellen/paketID und /en/checkout/PackageID

This commit is contained in:
Codex Agent
2025-12-20 16:17:21 +01:00
parent 18297aa3f1
commit 6500b8df2c
18 changed files with 331 additions and 345 deletions

View File

@@ -0,0 +1,28 @@
<?php
namespace App\Support;
use App\Models\Package;
class CheckoutRoutes
{
public static function slugForLocale(?string $locale = null): string
{
$normalized = LocaleConfig::canonicalize($locale ?? app()->getLocale());
return $normalized === 'en' ? 'checkout' : 'bestellen';
}
public static function wizardUrl(Package|int $package, ?string $locale = null): string
{
$normalized = LocaleConfig::canonicalize($locale ?? app()->getLocale());
$slug = self::slugForLocale($normalized);
$packageId = $package instanceof Package ? $package->getKey() : $package;
return route('checkout.show', [
'locale' => $normalized,
'checkoutSlug' => $slug,
'package' => $packageId,
]);
}
}