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 @@
@endif
{{-- Structured Data --}}
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "SportsActivityLocation",
"name": "{{ $academy->name_ar }}",
"description": "{{ $settings->site_description ?? '' }}",
"url": "{{ url()->current() }}",
@if($academy->logo_path)
"image": "{{ asset('storage/' . $academy->logo_path) }}",
@endif
"address": {
"@type": "PostalAddress",
"addressCountry": "EG"
@php
$jsonLd = [
'@context' => 'https://schema.org',
'@type' => 'SportsActivityLocation',
'name' => $academy->name_ar,
'description' => $settings->site_description ?? '',
'url' => url()->current(),
'address' => ['@type' => 'PostalAddress', 'addressCountry' => 'EG'],
];
if ($academy->logo_path) {
$jsonLd['image'] = asset('storage/' . $academy->logo_path);
}
}
</script>
@endphp
<script type="application/ld+json">{!! json_encode($jsonLd, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT) !!}</script>
@if($settings->google_analytics_id)
<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