<?php
namespace Komma\Categories;
use Komma\Categories\Models\Category;
class CategoryComposer
{
public function compose($view)
{
$categories = Category::where('lft', '!=', 1)
->with([
'translation',
'translation.route',
'images',
])
->orderBy('lft')
->get();
$view->with(['categories'=> $categories]);
}
}