<?php
/**
 * Created by PhpStorm.
 * User: radko
 * Date: 19.11.18
 * Time: 13:56
 */

namespace Seka\Vzdelavanie\Composers\Kniznica;

use Illuminate\View\View;
use Seka\Vzdelavanie\Services\KategoriaServiceInterface;

/**
 * Class ZoznamUcebnychMaterialovPodlaKategoriiComposer
 * @package Seka\Vzdelavanie\Composers\Kniznica
 */
class ZoznamUcebnychMaterialovPodlaKategoriiComposer
{
    /**
     * @var \Seka\Vzdelavanie\Services\KategoriaServiceInterface
     */
    private $service;

    /**
     * ZoznamKategoriiComposer constructor.
     * @param \Seka\Vzdelavanie\Services\KategoriaServiceInterface $service
     */
    public function __construct(KategoriaServiceInterface $service)
    {
        $this->service = $service;
    }

    /**
     * @param \Illuminate\View\View $view
     *
     * @return \Illuminate\View\View
     */
    public function compose(View $view): View
    {
        return $view->with('kategorieSUcebnymMaterialom', $this->service->vratVsetkySUcebnymiMaterialmi(5));
    }
}
