<?php

namespace App\Classes\Modules\Warehouses\Services;

use App\Http\Resources\Warehouse as WarehouseResource;
use App\Models\Warehouse;

class ListsWarehouse
{
    /** @var  Warehouse */
    private $repository;

    /**
     * ListsWarehouse constructor.
     * @param Warehouse $repository
     */
    public function __construct(Warehouse $repository)
    {
        $this->repository = $repository;
    }

    public function execute(){

        $warehouses = $this->repository->orderBy('created_at')->paginate(10);

        return WarehouseResource::collection($warehouses);

    }

}