<?php
/**
 * Created by PhpStorm.
 * User: radko
 * Date: 15.11.18
 * Time: 14:40
 */

namespace Seka\Portal\Modul\Vzdelavanie\Composers\Kniznica;

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

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

    /**
     * ZoznamKategoriiComposer constructor.
     *
     * @param \Seka\Portal\Modul\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('zoznamKategorii', $this->service->vratVsetky());
    }
}
