footer brands
This commit is contained in:
parent
91e325b248
commit
7017d38f12
|
|
@ -27,7 +27,9 @@ class BrandRepository
|
|||
|
||||
return Brand::whereIn('name', $ids)->orderBy('priority', 'desc')
|
||||
->where('priority', '>', 0)
|
||||
->orderBy('name', 'asc')->get();
|
||||
->orderBy('name', 'asc')
|
||||
|
||||
->get();
|
||||
}
|
||||
|
||||
return Brand::orderBy('priority', 'desc')->orderBy('name', 'asc')
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
namespace App\View\Components;
|
||||
|
||||
use App\Repositories\Catalog\BrandRepository;
|
||||
use Closure;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\View\Component;
|
||||
|
||||
class FooterBrands extends Component
|
||||
{
|
||||
public $brands;
|
||||
|
||||
/**
|
||||
* Create a new component instance.
|
||||
*/
|
||||
public function __construct(BrandRepository $brandRepository)
|
||||
{
|
||||
$this->brands = $brandRepository->getList([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*/
|
||||
public function render(): View|Closure|string
|
||||
{
|
||||
return view('components.footer-brands', ['brands' => $this->brands]);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
@if($brands && $brands->count() > 0)
|
||||
<ul class="nav flex-column gap-2 pt-sm-3 pb-3 pb-sm-0 mt-n1 mb-1 mb-sm-0">
|
||||
|
||||
@foreach($brands as $index => $brand)
|
||||
<li class="d-flex w-100 pt-1">
|
||||
|
||||
<a class="nav-link animate-underline animate-target d-inline fw-normal text-truncate p-0"
|
||||
href="{{ route('product.index',['filter[brand_id]'=>$brand->id]) }}">{{ $brand->name }}</a>
|
||||
</li>
|
||||
|
||||
@endforeach
|
||||
</ul>
|
||||
@endif
|
||||
|
|
@ -75,31 +75,14 @@
|
|||
</div>
|
||||
<div class="accordion-item col-sm-4 border-0">
|
||||
<h6 class="accordion-header" id="membersHeading">
|
||||
<span class="text-dark-emphasis d-none d-sm-block">For members</span>
|
||||
<span class="text-dark-emphasis d-none d-sm-block">Brands</span>
|
||||
<button type="button" class="accordion-button collapsed py-3 d-sm-none"
|
||||
data-bs-toggle="collapse" data-bs-target="#membersLinks" aria-expanded="false"
|
||||
aria-controls="membersLinks">For members</button>
|
||||
aria-controls="membersLinks">Brands</button>
|
||||
</h6>
|
||||
<div class="accordion-collapse collapse d-sm-block" id="membersLinks"
|
||||
aria-labelledby="membersHeading" data-bs-parent="#footerLinks">
|
||||
<ul class="nav flex-column gap-2 pt-sm-3 pb-3 pb-sm-0 mt-n1 mb-1 mb-sm-0">
|
||||
<li class="d-flex w-100 pt-1">
|
||||
<a class="nav-link animate-underline animate-target d-inline fw-normal text-truncate p-0"
|
||||
href="#!">Licenses</a>
|
||||
</li>
|
||||
<li class="d-flex w-100 pt-1">
|
||||
<a class="nav-link animate-underline animate-target d-inline fw-normal text-truncate p-0"
|
||||
href="#!">Return policy</a>
|
||||
</li>
|
||||
<li class="d-flex w-100 pt-1">
|
||||
<a class="nav-link animate-underline animate-target d-inline fw-normal text-truncate p-0"
|
||||
href="#!">Payment methods</a>
|
||||
</li>
|
||||
<li class="d-flex w-100 pt-1">
|
||||
<a class="nav-link animate-underline animate-target d-inline fw-normal text-truncate p-0"
|
||||
href="#!">Become a vendor</a>
|
||||
</li>
|
||||
</ul>
|
||||
<x-footer-brands />
|
||||
</div>
|
||||
<hr class="d-sm-none my-0">
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue