29 lines
595 B
PHP
29 lines
595 B
PHP
<?php
|
|
|
|
namespace App\View\Components\Home;
|
|
|
|
use App\Repositories\Catalog\ProductRepository;
|
|
use Illuminate\View\Component;
|
|
use Illuminate\View\View;
|
|
|
|
class NewArrivals extends Component
|
|
{
|
|
public $products;
|
|
|
|
public function __construct(ProductRepository $productRepository)
|
|
{
|
|
$params = [
|
|
'sort' => 'new',
|
|
];
|
|
$this->products = $productRepository->getList($params);
|
|
}
|
|
|
|
/**
|
|
* Get the view/contents that represent the component.
|
|
*/
|
|
public function render(): View
|
|
{
|
|
return view('components.home.new-arrivals');
|
|
}
|
|
}
|