@php $catalog = app(\App\Support\IndustryNavCatalog::class); $meta = $catalog->itemMeta(); $categoryDefs = $catalog->categories(); $industryIcons = [ 'small-business' => '🏪', 'medium-business' => '🏢', 'agencies' => '🎯', 'startups' => '🚀', 'professional-services' => '💼', 'real-estate' => '🏠', 'healthcare' => '🏥', 'finance' => '📊', 'legal' => '⚖️', 'ecommerce' => '🛒', ]; $slugToCategory = []; foreach ($categoryDefs as $cat) { foreach ($cat['slugs'] as $slug) { $slugToCategory[$slug] = $cat['key']; } } $industryItems = collect($industries ?? [])->values()->map(function ($industry) use ($meta, $slugToCategory, $categoryDefs, $industryIcons) { $itemMeta = $meta[$industry->slug] ?? [ 'line1' => \Illuminate\Support\Str::limit(strip_tags($industry->description ?? ''), 100), 'line2' => '', 'accent' => 'emerald', ]; $categoryKey = $slugToCategory[$industry->slug] ?? 'business-size'; $categoryLabel = collect($categoryDefs)->firstWhere('key', $categoryKey)['label'] ?? 'Industries'; return [ 'slug' => $industry->slug, 'name' => $industry->name, 'url' => route('industries.show', $industry->slug), 'line1' => $itemMeta['line1'], 'line2' => $itemMeta['line2'] ?? '', 'accent' => $itemMeta['accent'] ?? 'emerald', 'icon' => $industryIcons[$industry->slug] ?? '🏢', 'category_key' => $categoryKey, 'category_label' => $categoryLabel, ]; }); if ($industryItems->isEmpty()) { $industryItems = collect($meta)->take(8)->map(function ($itemMeta, $slug) use ($slugToCategory, $categoryDefs, $industryIcons) { $categoryKey = $slugToCategory[$slug] ?? 'business-size'; $categoryLabel = collect($categoryDefs)->firstWhere('key', $categoryKey)['label'] ?? 'Industries'; return [ 'slug' => $slug, 'name' => str($slug)->title()->replace('-', ' ')->toString(), 'url' => route('industries.show', $slug), 'line1' => $itemMeta['line1'], 'line2' => $itemMeta['line2'] ?? '', 'accent' => $itemMeta['accent'] ?? 'emerald', 'icon' => $industryIcons[$slug] ?? '🏢', 'category_key' => $categoryKey, 'category_label' => $categoryLabel, ]; })->values(); } $filterCategories = collect($categoryDefs)->map(fn ($cat) => [ 'key' => $cat['key'], 'label' => $cat['label'], 'accent' => $cat['accent'], ])->values()->all(); @endphp
@php $industriesCopy = $home['industries'] ?? []; @endphp
@if($industryItems->isNotEmpty()) @endif