@php $siteName = config('seo.site_name', config('app.name', 'PC Shop')); $metaTitleRaw = trim($__env->yieldContent('meta_title')); $metaTitle = $metaTitleRaw !== '' ? "{$metaTitleRaw} - {$siteName}" : config('seo.default_title', $siteName); $metaDescription = trim($__env->yieldContent('meta_description')) ?: config('seo.default_description'); $metaKeywords = trim($__env->yieldContent('meta_keywords')) ?: config('seo.default_keywords'); $metaCanonical = trim($__env->yieldContent('meta_canonical')) ?: url()->current(); $metaOgType = trim($__env->yieldContent('meta_og_type')) ?: 'website'; $request = request(); $defaultNoIndex = $request->is('admin*') || $request->routeIs( 'favorites.*', 'compare.*', 'cart.*', 'checkout.*', 'account*', 'login', 'login.attempt', 'register', 'register.store' ); $metaRobots = trim($__env->yieldContent('meta_robots')) ?: ($defaultNoIndex ? 'noindex,nofollow' : 'index,follow'); $metaImagePath = trim($__env->yieldContent('meta_image')) ?: config('seo.default_image'); $metaImage = str_starts_with($metaImagePath, 'http://') || str_starts_with($metaImagePath, 'https://') ? $metaImagePath : url($metaImagePath); $metaImageAlt = trim($__env->yieldContent('meta_image_alt')) ?: $metaTitle; $siteUrl = url('/'); $companyName = config('shop.company_name', $siteName); $companyDescription = config('shop.company_description', $metaDescription); $companyPhone = trim((string) config('shop.contact_phone', '')); $companyEmail = trim((string) config('shop.contact_email', '')); $companyAddress = trim((string) config('shop.contact_address', '')); $companyTelegram = trim((string) config('shop.contact_telegram', '')); if ($companyTelegram !== '' && str_starts_with($companyTelegram, '@')) { $companyTelegram = 'https://t.me/' . ltrim($companyTelegram, '@'); } $organizationSchema = [ '@context' => 'https://schema.org', '@type' => 'Organization', 'name' => $companyName, 'url' => $siteUrl, 'description' => $companyDescription, ]; if ($companyPhone !== '') { $organizationSchema['telephone'] = $companyPhone; } if ($companyEmail !== '') { $organizationSchema['email'] = $companyEmail; } if ($companyAddress !== '') { $organizationSchema['address'] = [ '@type' => 'PostalAddress', 'streetAddress' => $companyAddress, ]; } if ($companyTelegram !== '' && (str_starts_with($companyTelegram, 'http://') || str_starts_with($companyTelegram, 'https://'))) { $organizationSchema['sameAs'] = [$companyTelegram]; } $websiteSchema = [ '@context' => 'https://schema.org', '@type' => 'WebSite', 'name' => $siteName, 'url' => $siteUrl, 'potentialAction' => [ '@type' => 'SearchAction', 'target' => route('search.index') . '?q={search_term_string}', 'query-input' => 'required name=search_term_string', ], ]; @endphp