File: D:/HostingSpaces/BVerhoeven/verhoevendak.nl/app/Komma/Categories/CategoryComposer.php
<?php
namespace Komma\Categories;
class CategoryComposer
{
/**
* @var CategoryService
*/
private $categoryService;
/**
* CategoryComposer constructor.
* @param CategoryService $categoryService
*/
public function __construct(CategoryService $categoryService)
{
$this->categoryService = $categoryService;
}
/**
* Compose data for the view
*/
public function compose($view)
{
$categories = $this->categoryService->getAllCategories();
$view->with(['categories'=> $categories]);
}
}