{{-- SEO Meta Tags --}} {{-- {!! SEO::generate() !!} --}} @stack('meta') {!! App\Helpers\SeoHelper::renderStructuredData() !!} @stack('structured_data') {{-- Dynamic Title --}} @hasSection('title') @yield('title') - {{ config('app.name') }} @else {{ $pageTitle ?? $title ?? config('app.name') }} @endif {{-- Meta Description --}} @hasSection('meta_description') @else @endif {{-- Meta Keywords --}} @if(isset($metaKeywords) || isset($meta_keywords)) @endif {{-- Open Graph Tags --}} @if(isset($ogImage) || isset($og_image)) @endif {{-- Twitter Card Tags --}} @if(isset($twitterImage) || isset($twitter_image)) @endif {{-- Canonical URL --}} @if(isset($canonicalUrl) || isset($canonical_url)) @else @endif {{-- Favicon --}} {{-- Fonts --}} @if(app()->getLocale() === 'ar') @else @endif {{-- CSS --}} @if(app()->getLocale() === 'ar') @else @endif @if(file_exists(public_path('css/app.css'))) @endif {{-- Hreflang Tags --}} @php $currentRoute = Route::currentRouteName(); $currentParams = Route::current()->parameters(); $locales = ['ar', 'en', 'fr']; @endphp @foreach($locales as $locale) @php try { if (in_array($currentRoute, ['products.show', 'categories.show']) && isset($currentParams[0])) { $model = $currentRoute === 'products.show' ? App\Models\Product::whereHas('translations', function($q) use ($currentParams) { $q->where('slug', $currentParams[0]); })->first() : App\Models\Category::whereHas('translations', function($q) use ($currentParams) { $q->where('slug', $currentParams[0]); })->first(); if ($model && $model->translate($locale)) { $translatedSlug = $model->translate($locale)->slug; $hreflangUrl = route($currentRoute, $translatedSlug, true, $locale); } else { $hreflangUrl = null; } } else { $hreflangUrl = route($currentRoute, $currentParams, true, $locale); } } catch (\Exception $e) { $hreflangUrl = null; } @endphp @if($hreflangUrl) @endif @endforeach {{-- Enhanced Meta Tags --}} {{-- Structured Data --}} @push('structured_data') @endpush @push('structured_data') @endpush @stack('styles') {{-- Enhanced Navigation --}} {{-- Enhanced Flash Messages --}} @if(session('success')) @endif @if(session('error')) @endif @if(session('warning')) @endif @if(session('info')) @endif {{-- Main Content --}}
@yield('content')
{{-- Enhanced Footer --}} {{-- Toast Container --}}
{{-- Logout Form --}}
@csrf
{{-- Scripts --}} @if(file_exists(public_path('js/app.js'))) @endif @stack('scripts')