/**
  * Generates the group listing for the view.
  *
  * @param View $view
  */
 public function compose(View $view)
 {
     $active_group = null;
     $active_project = null;
     if (isset($view->project) && !$view->project->is_template) {
         $active_group = $view->project->group_id;
         $active_project = $view->project->id;
     }
     $view->with('active_group', $active_group);
     $view->with('active_project', $active_project);
     $view->with('groups', $this->groupRepository->getAll());
 }
 /**
  * Shows all projects.
  *
  * @param TemplateRepositoryInterface $templateRepository
  * @param GroupRepositoryInterface $groupRepository
  * @param Request $request
  *
  * @return \Illuminate\View\View
  */
 public function index(TemplateRepositoryInterface $templateRepository, GroupRepositoryInterface $groupRepository, Request $request)
 {
     $projects = $this->repository->getAll();
     return view('admin.projects.listing', ['is_secure' => $request->secure(), 'title' => Lang::get('projects.manage'), 'templates' => $templateRepository->getAll(), 'groups' => $groupRepository->getAll(), 'projects' => $projects->toJson()]);
 }