From 7baffc9cb5a2c660c1a74679e868d1fedd8814d1 Mon Sep 17 00:00:00 2001 From: Bayu Lukman Yusuf Date: Fri, 20 Feb 2026 11:24:25 +0700 Subject: [PATCH] add category, brands, gender navbar --- app/View/Components/Layout/NavbarCategory.php | 10 +- .../views/components/layout/header.blade.php | 2 +- .../layout/navbar-category.blade.php | 136 ++++++++++++------ 3 files changed, 101 insertions(+), 47 deletions(-) diff --git a/app/View/Components/Layout/NavbarCategory.php b/app/View/Components/Layout/NavbarCategory.php index dba898f..1642d48 100644 --- a/app/View/Components/Layout/NavbarCategory.php +++ b/app/View/Components/Layout/NavbarCategory.php @@ -4,6 +4,8 @@ namespace App\View\Components\Layout; use App\Repositories\Catalog\CategoryRepository; use App\Repositories\Catalog\GenderRepository; +use App\Repositories\Catalog\BrandRepository; + use Closure; use Illuminate\Contracts\View\View; use Illuminate\View\Component; @@ -13,6 +15,7 @@ class NavbarCategory extends Component public $genders = []; public $categories = []; + public $brands = []; /** * Create a new component instance. */ @@ -22,13 +25,18 @@ class NavbarCategory extends Component $genderRepository = new GenderRepository(); $categoryRepository = new CategoryRepository(); + $brandsRepository = new BrandRepository(); $this->genders = $genderRepository->getList([]); + $this->genders = collect($this->genders)->chunk(7); + $this->categories = $categoryRepository->getList([]); // chunk $this->categories = collect($this->categories)->chunk(7); - + + $this->brands = $brandsRepository->getList([]); + $this->brands = collect($this->brands)->chunk(7); } /** diff --git a/resources/views/components/layout/header.blade.php b/resources/views/components/layout/header.blade.php index a9d04b9..cd99a37 100644 --- a/resources/views/components/layout/header.blade.php +++ b/resources/views/components/layout/header.blade.php @@ -269,7 +269,7 @@ - +