diff --git a/app/Attributes/SeoDataAttribute.php b/app/Attributes/SeoDataAttribute.php
index cd83d30..051bc15 100644
--- a/app/Attributes/SeoDataAttribute.php
+++ b/app/Attributes/SeoDataAttribute.php
@@ -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(
diff --git a/app/helpers.php b/app/helpers.php
index 61d412e..8b38672 100644
--- a/app/helpers.php
+++ b/app/helpers.php
@@ -13,3 +13,37 @@ if (!function_exists('route_with_country')) {
return route($name, $parameters, $absolute);
}
}
+
+if (!function_exists('get_domain_image')) {
+ function get_domain_image(): string
+ {
+ $langCountry = session('lang_country', 'de-DE');
+
+ // Check if specific domain image exists
+ 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
+ ];
+
+ // Use LAT image for South American countries
+ if (in_array($langCountry, $southAmericanCountries, true)) {
+ return asset('img/domains/lat.png');
+ }
+
+ return asset('img/domains/'.$langCountry.'.jpg');
+ }
+}
diff --git a/resources/views/components/app-logo-icon.blade.php b/resources/views/components/app-logo-icon.blade.php
index 47ffe96..97c642a 100644
--- a/resources/views/components/app-logo-icon.blade.php
+++ b/resources/views/components/app-logo-icon.blade.php
@@ -1,29 +1,4 @@
-@php
- $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');
- }
-@endphp
-
-@if($langCountry === 'de-DE')
+@if(session('lang_country', 'de-DE') === 'de-DE')
@else
-
+
@endif