🌍 Refactor domain image logic into reusable helper function

- Moved domain image selection logic into `get_domain_image` helper for reusability.
- Simplified `app-logo-icon.blade.php` and `SeoDataAttribute` by replacing inline logic with the new helper.
- Improved maintainability and consistency for handling `lang_country` sessions.
This commit is contained in:
HolgerHatGarKeineNode
2025-11-23 23:13:41 +01:00
parent 0a93b2b90b
commit e07245e69a
3 changed files with 37 additions and 49 deletions

View File

@@ -17,28 +17,7 @@ class SeoDataAttribute
private static function initDefinitions(): void
{
$langCountry = session('lang_country', 'de-DE');
$domainImage = asset('img/domains/'.$langCountry.'.jpg');
if (!file_exists(public_path('img/domains/'.$langCountry.'.jpg'))) {
$langCountry = 'de-DE';
}
$southAmericanCountries = [
'ar-AR', // Argentina
'bo-BO', // Bolivia
'br-BR', // Brazil
'cl-CL', // Chile
'co-CO', // Colombia
'ec-EC', // Ecuador
'gy-GY', // Guyana
'py-PY', // Paraguay
'pe-PE', // Peru
'sr-SR', // Suriname
'uy-UY', // Uruguay
've-VE', // Venezuela
];
if (in_array($langCountry, $southAmericanCountries, true)) {
$domainImage = asset('img/domains/lat.png');
}
$domainImage = get_domain_image();
self::$seoDefinitions = [
'login' => new SEOData(