ECOMMERCE/app/View/Components/Grocery/HomeSlider.php

30 lines
601 B
PHP

<?php
namespace App\View\Components\Grocery;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
use App\Repositories\Member\BannerRepository;
class HomeSlider extends Component
{
public $items;
public function __construct(BannerRepository $repository)
{
$this->items = $repository->getList([]);
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.grocery.home-slider', [
'items' => $this->items
]);
}
}