presseportale/app/Enums/Portal.php
Kevin Adametz 0efabaf446 Multi-Domain-Asset-Infrastruktur: geteilte Vite-Konfiguration und DomainAssetContext
- vite.shared.js als gemeinsame Quelle fuer Ports, Hot-Files, HMR-Hosts
  und CORS-Origins der beiden Vite-Builds (Portal/Web)
- App\Support\DomainAssetContext kapselt die Vite-Build-Directory-
  Konfiguration pro Domain (ThemeServiceProvider + Auth-Layout nutzen ihn)
- Tailwind-Portal-Content-Globs auf die tatsaechliche View-Struktur gezogen
- Dev-Beispiel-Routen + Tests (DomainAssetContextTest, DevExampleRoutesTest)
- Aufraeumen: versehentliche Leerdatei dev:web entfernt

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 08:16:09 +00:00

38 lines
971 B
PHP

<?php
namespace App\Enums;
enum Portal: string
{
case Presseecho = 'presseecho';
case Businessportal24 = 'businessportal24';
case Both = 'both';
public function label(): string
{
return match ($this) {
self::Presseecho => 'Presseecho',
self::Businessportal24 => 'Businessportal24',
self::Both => 'Beide Portale',
};
}
public function abbreviation(): string
{
return match ($this) {
self::Presseecho => 'PE',
self::Businessportal24 => 'B24',
self::Both => 'PE+B24',
};
}
public static function stripTrailingAbbreviation(string $value): string
{
$abbreviations = implode('|', array_map(
fn (self $portal): string => preg_quote($portal->abbreviation(), '/'),
self::cases(),
));
return trim((string) preg_replace('/\s*\(('.$abbreviations.')\)\s*$/u', '', $value));
}
}