Add show_in_nav option for categories in top menu
Deploy to Production (witstore.wende.it) / deploy (push) Successful in 6s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-20 19:16:12 +02:00
co-authored by Claude Sonnet 4.6
parent f1addad742
commit 4916edab7f
5 changed files with 42 additions and 2 deletions
+12
View File
@@ -33,6 +33,11 @@
->orderBy('nav_sort')
->orderBy('title')
->get();
$navCategories = \App\Models\Category::whereNull('parent_id')
->where('active', true)
->where('show_in_nav', true)
->orderBy('sort_order')
->get();
@endphp
{{-- Header: Logo-Leiste --}}
@@ -57,6 +62,13 @@
class="px-3 py-2 rounded-lg text-sm font-medium text-gray-700 hover:bg-blue-50 hover:text-blue-700 transition">
Alle Produkte
</a>
@foreach($navCategories as $navCat)
<a href="{{ route('shop.category', $navCat->slug) }}"
class="px-3 py-2 rounded-lg text-sm font-medium text-gray-700 hover:bg-blue-50 hover:text-blue-700 transition
{{ request()->route('slug') === $navCat->slug ? 'bg-blue-50 text-blue-700' : '' }}">
{{ $navCat->name }}
</a>
@endforeach
@foreach($navPages as $navPage)
<a href="{{ route('page', $navPage->slug) }}"
class="px-3 py-2 rounded-lg text-sm font-medium text-gray-700 hover:bg-blue-50 hover:text-blue-700 transition