<?php namespace App\Composers;
use App\Projects\Models\Project;
use Illuminate\View\View;
class FeaturedProjectsComposer
{
/**
* @param View $view
*/
public function compose($view)
{
$rootProject = Project::where('lft', '=', 1)->first();
$rootChildren = collect($rootProject->findChildren());
$view->with('featuredProjects', $rootChildren->take(2));
}
}