Commit d4ecf0e2 authored by Mahmoud Aglan's avatar Mahmoud Aglan

Fix Blade compile error: move @if out of JSON-LD script block

Livewire's ExtendedCompilerEngine misparses @if inside <script> tags.
Replaced inline Blade conditionals with @php block + json_encode.
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 891abd7d
...@@ -42,22 +42,20 @@ ...@@ -42,22 +42,20 @@
@endif @endif
{{-- Structured Data --}} {{-- Structured Data --}}
<script type="application/ld+json"> @php
{ $jsonLd = [
"@context": "https://schema.org", '@context' => 'https://schema.org',
"@type": "SportsActivityLocation", '@type' => 'SportsActivityLocation',
"name": "{{ $academy->name_ar }}", 'name' => $academy->name_ar,
"description": "{{ $settings->site_description ?? '' }}", 'description' => $settings->site_description ?? '',
"url": "{{ url()->current() }}", 'url' => url()->current(),
@if($academy->logo_path) 'address' => ['@type' => 'PostalAddress', 'addressCountry' => 'EG'],
"image": "{{ asset('storage/' . $academy->logo_path) }}", ];
@endif if ($academy->logo_path) {
"address": { $jsonLd['image'] = asset('storage/' . $academy->logo_path);
"@type": "PostalAddress",
"addressCountry": "EG"
} }
} @endphp
</script> <script type="application/ld+json">{!! json_encode($jsonLd, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT) !!}</script>
@if($settings->google_analytics_id) @if($settings->google_analytics_id)
<script async src="https://www.googletagmanager.com/gtag/js?id={{ $settings->google_analytics_id }}"></script> <script async src="https://www.googletagmanager.com/gtag/js?id={{ $settings->google_analytics_id }}"></script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment