@php $s = $webSettings ?? []; $path = trim((string) request()->path(), '/'); $segments = request()->segments(); $defaultPageMeta = [ '' => [ 'title' => $s['site_title'] ?? 'Ronnie Ridge | Software Development Company in USA', 'description' => $s['site_description'] ?? 'Software Development Company in USA delivering AI development in Maryland and scalable engineering support from our Lahore software house.', 'keywords' => $s['site_keywords'] ?? 'software development company in usa, ai development company maryland, software house in lahore, web development, mobile app, AI', ], 'about' => [ 'title' => 'About Us | Ronnie Ridge', 'description' => 'Learn about Ronnie Ridge - a premium technology partner dedicated to transforming businesses through innovative digital solutions.', 'keywords' => 'about, technology partner, web development, digital solutions', ], 'services' => [ 'title' => 'Our Services | Ronnie Ridge', 'description' => 'Comprehensive digital solutions: web development, mobile apps, AI, and digital marketing.', 'keywords' => 'web development, mobile app, AI, digital marketing, services', ], 'case-study' => [ 'title' => 'Case Studies | Ronnie Ridge', 'description' => 'Transformative results achieved for our global clients.', 'keywords' => 'case studies, portfolio, projects, success stories', ], 'blog' => [ 'title' => 'Blog | Insights & Resources | Ronnie Ridge', 'description' => 'Expert insights on web development, mobile apps, AI solutions, and digital transformation.', 'keywords' => 'blog, tech insights, web development, mobile apps, AI, digital transformation', ], 'careers' => [ 'title' => 'Careers | Join Our Team | Ronnie Ridge', 'description' => 'Explore career opportunities at Ronnie Ridge. We are hiring for web development, mobile apps, AI, and digital marketing roles.', 'keywords' => 'careers, jobs, hiring, tech jobs, web development jobs, software engineer', ], 'industries' => [ 'title' => 'Industries | Ronnie Ridge', 'description' => 'Tailored digital solutions for healthcare, finance, retail, and more.', 'keywords' => 'industries, healthcare, finance, retail, digital solutions', ], 'contact' => [ 'title' => 'Contact Us | Ronnie Ridge', 'description' => 'Get in touch with Ronnie Ridge for premium web development, mobile apps, AI solutions, and digital marketing.', 'keywords' => 'contact, get a quote, consultation', ], 'faq' => [ 'title' => 'FAQ | Ronnie Ridge', 'description' => 'Frequently asked questions about our web development, mobile app, AI, and digital marketing services.', 'keywords' => 'FAQ, questions, web development, mobile app, AI, digital marketing', ], 'sitemap' => [ 'title' => 'Sitemap | Ronnie Ridge', 'description' => 'Browse all pages of Ronnie Ridge in one place.', 'keywords' => 'sitemap, pages, navigation', ], 'privacy-policy' => [ 'title' => 'Privacy Policy | Ronnie Ridge', 'description' => 'Ronnie Ridge Privacy Policy - how we collect, use, and protect your information.', 'keywords' => 'privacy policy, data protection', ], 'terms-of-service' => [ 'title' => 'Terms of Service | Ronnie Ridge', 'description' => 'Ronnie Ridge Terms of Service.', 'keywords' => 'terms of service, legal', ], 'cookie-policy' => [ 'title' => 'Cookie Policy | Ronnie Ridge', 'description' => 'Ronnie Ridge Cookie Policy - how we use cookies.', 'keywords' => 'cookies, cookie policy', ], 'human-rights-policy' => [ 'title' => 'Human Rights Policy | Ronnie Ridge', 'description' => 'Ronnie Ridge commitment to human rights in our operations and supply chain.', 'keywords' => 'human rights, policy, ethics', ], 'modern-slavery-act' => [ 'title' => 'Modern Slavery Act Statement | Ronnie Ridge', 'description' => 'Ronnie Ridge Modern Slavery Act statement and commitment to ethical practices.', 'keywords' => 'modern slavery act, transparency, supply chain', ], ]; $policySlugs = ['about', 'privacy-policy', 'terms-of-service', 'cookie-policy', 'human-rights-policy', 'modern-slavery-act']; $pageSeo = []; if (in_array($path, $policySlugs, true)) { $pageContent = \App\Models\PageContent::find($path)?->content ?? \App\Models\PageContent::getDefaultsFor($path); $pageSeo = is_array($pageContent['seo'] ?? null) ? $pageContent['seo'] : []; } $resourceSeo = []; if (($segments[0] ?? '') === 'services' && !empty($segments[1])) { $resource = \App\Models\Service::query()->where('slug', urldecode((string) $segments[1]))->first(); if ($resource) { $resourceSeo = [ 'meta_title' => $resource->meta_title, 'meta_description' => $resource->meta_description, 'meta_keywords' => $resource->meta_keywords, 'og_image' => $resource->og_image ?: $resource->hero_image, ]; } } elseif (($segments[0] ?? '') === 'case-study' && !empty($segments[1])) { $resource = \App\Models\CaseStudy::query()->where('slug', urldecode((string) $segments[1]))->first(); if ($resource) { $resourceSeo = [ 'meta_title' => $resource->meta_title, 'meta_description' => $resource->meta_description, 'meta_keywords' => $resource->meta_keywords, 'og_image' => $resource->og_image ?: $resource->image, ]; } } elseif (($segments[0] ?? '') === 'blog' && !empty($segments[1])) { $resource = \App\Models\Blog::query()->where('slug', urldecode((string) $segments[1]))->first(); if ($resource) { $resourceSeo = [ 'meta_title' => $resource->meta_title, 'meta_description' => $resource->meta_description ?: $resource->excerpt, 'meta_keywords' => $resource->meta_keywords, 'og_image' => $resource->og_image ?: $resource->featured_image, ]; } } elseif (($segments[0] ?? '') === 'careers' && !empty($segments[1])) { $resource = \App\Models\JobListing::query()->where('slug', urldecode((string) $segments[1]))->first(); if ($resource) { $resourceSeo = [ 'meta_title' => $resource->meta_title, 'meta_description' => $resource->meta_description ?: $resource->short_description, 'meta_keywords' => $resource->meta_keywords, 'og_image' => $resource->og_image, ]; } } elseif (($segments[0] ?? '') === 'industries' && !empty($segments[1])) { $resource = \App\Models\Industry::query()->where('slug', urldecode((string) $segments[1]))->first(); if ($resource) { $resourceSeo = [ 'meta_title' => $resource->meta_title, 'meta_description' => $resource->meta_description ?: $resource->short_description, 'meta_keywords' => $resource->meta_keywords, 'og_image' => $resource->og_image ?: $resource->hero_image, ]; } } $canonicalBase = $s['canonical_base_url'] ?? null; $canonicalUrl = $canonicalBase ? rtrim($canonicalBase, '/') . (request()->path() ? '/' . request()->path() : '') : url()->current(); $geoMeta = \App\Support\Seo\SeoMetaHelper::geoMeta(); $pageKey = $path; if (($segments[0] ?? '') === 'services') $pageKey = 'services'; if (($segments[0] ?? '') === 'case-study') $pageKey = 'case-study'; if (($segments[0] ?? '') === 'blog') $pageKey = 'blog'; if (($segments[0] ?? '') === 'careers') $pageKey = 'careers'; if (($segments[0] ?? '') === 'industries') $pageKey = 'industries'; $defaults = $defaultPageMeta[$pageKey] ?? $defaultPageMeta['']; $resolvedTitle = trim((string) ( $resourceSeo['meta_title'] ?? $pageSeo['meta_title'] ?? (($path === 'contact') ? ($s['contact_meta_title'] ?? '') : '') ?? ($defaults['title'] ?? '') ?? ($s['site_title'] ?? '') )); if ($resolvedTitle === '') { $resolvedTitle = 'Ronnie Ridge | Software Development Company in USA'; } $resolvedDescription = trim((string) ( $resourceSeo['meta_description'] ?? $pageSeo['meta_description'] ?? (($path === 'contact') ? ($s['contact_meta_description'] ?? '') : '') ?? ($defaults['description'] ?? '') ?? ($s['site_description'] ?? '') )); if ($resolvedDescription === '') { $resolvedDescription = 'Software Development Company in USA delivering AI development in Maryland and scalable engineering support from our Lahore software house.'; } $resolvedKeywords = trim((string) ( $resourceSeo['meta_keywords'] ?? $pageSeo['meta_keywords'] ?? (($path === 'contact') ? ($s['contact_meta_keywords'] ?? '') : '') ?? ($defaults['keywords'] ?? '') ?? ($s['site_keywords'] ?? '') )); if ($resolvedKeywords === '') { $resolvedKeywords = 'software development company in usa, ai development company maryland, software house in lahore, web development, mobile app, AI'; } $rawOgImage = $resourceSeo['og_image'] ?? $pageSeo['og_image'] ?? (($path === 'contact') ? ($s['contact_og_image'] ?? '') : '') ?? ($s['og_image'] ?? ($s['contact_og_image'] ?? '')); $effectiveOgImage = ''; if (!empty($rawOgImage)) { $effectiveOgImage = str_starts_with($rawOgImage, 'http://') || str_starts_with($rawOgImage, 'https://') ? $rawOgImage : url($rawOgImage); } @endphp