diff --git a/app/Support/StructuredData.php b/app/Support/StructuredData.php index 3656938..312fa01 100644 --- a/app/Support/StructuredData.php +++ b/app/Support/StructuredData.php @@ -57,9 +57,6 @@ abstract class StructuredData return $node; } - /** - * @return array - */ protected static function organizationNode(): array { $siteUrl = static::siteUrl(); @@ -81,6 +78,40 @@ abstract class StructuredData ]; } + $phone = setting('contact_phone'); + if ($phone) { + $node['telephone'] = $phone; + } + + $email = setting('contact_email'); + if ($email) { + $node['email'] = $email; + } + + $address = setting('contact_address'); + if ($address) { + $node['address'] = [ + '@type' => 'PostalAddress', + 'streetAddress' => $address, + ]; + } + + $socialLinks = setting('social_links'); + if ($socialLinks) { + $links = is_string($socialLinks) ? json_decode($socialLinks, true) : $socialLinks; + if (is_array($links)) { + $sameAs = []; + foreach ($links as $platform => $url) { + if (!empty($url)) { + $sameAs[] = $url; + } + } + if (!empty($sameAs)) { + $node['sameAs'] = $sameAs; + } + } + } + return $node; } diff --git a/resources/views/templates/services/web-development.blade.php b/resources/views/templates/services/web-development.blade.php index bdacc6e..0bd30c5 100644 --- a/resources/views/templates/services/web-development.blade.php +++ b/resources/views/templates/services/web-development.blade.php @@ -2,6 +2,27 @@ @php $pageHero = $pageHero ?? \App\Support\PageTemplateHero::resolveForPage($page ?? null, 'services.web-development'); + + // Dynamicize social links + $socialLinks = setting('social_links'); + $sameAs = []; + if ($socialLinks) { + $links = is_string($socialLinks) ? json_decode($socialLinks, true) : $socialLinks; + if (is_array($links)) { + foreach ($links as $platform => $url) { + if (!empty($url)) { + $sameAs[] = $url; + } + } + } + } + if (empty($sameAs)) { + $sameAs = [ + "https://www.facebook.com/truncgil", + "https://www.instagram.com/truncgil", + "https://www.linkedin.com/company/truncgil-technology" + ]; + } @endphp @push('head') @@ -19,18 +40,14 @@ { "@@type": "ProfessionalService", "@@id": "{{ url()->current() }}#organization", - "name": "Trunçgil Teknoloji", - "image": "{{ asset('assets/img/logo.png') }}", + "name": "{{ setting('site_name', 'Trunçgil Teknoloji') }}", + "image": "{{ setting('site_logo') ? (str_starts_with(setting('site_logo'), 'http') ? setting('site_logo') : asset('storage/' . ltrim(setting('site_logo'), '/'))) : asset('assets/img/logo.png') }}", "url": "{{ url('/') }}", - "telephone": "+902244431620", + "telephone": "{{ setting('contact_phone', '+902244431620') }}", "priceRange": "$$$", "address": { "@@type": "PostalAddress", - "streetAddress": "Ulutek Teknoloji Geliştirme Bölgesi, Görükle Kampüsü, No: 104", - "addressLocality": "Nilüfer", - "addressRegion": "Bursa", - "postalCode": "16059", - "addressCountry": "TR" + "streetAddress": "{{ setting('contact_address', 'Ulutek Teknoloji Geliştirme Bölgesi, Görükle Kampüsü, No: 104') }}" }, "geo": { "@@type": "GeoCoordinates", @@ -49,11 +66,7 @@ "opens": "09:00", "closes": "18:00" }, - "sameAs": [ - "https://www.facebook.com/truncgil", - "https://www.instagram.com/truncgil", - "https://www.linkedin.com/company/truncgil-technology" - ] + "sameAs": {!! json_encode($sameAs, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) !!} }, { "@@type": "Service", @@ -920,7 +933,7 @@
-
+

{!! t('Teknoloji Ekosistemimiz') !!}

@@ -932,7 +945,7 @@