/** * The details of an individual project. * * @param int $project_id * * @return \Illuminate\View\View */ public function project($project_id) { $project = $this->projectRepository->getById($project_id); $optional = $project->commands->filter(function (Command $command) { return $command->optional; }); return view('projects.details', ['title' => $project->name, 'deployments' => $this->deploymentRepository->getLatest($project_id), 'today' => $this->deploymentRepository->getTodayCount($project_id), 'last_week' => $this->deploymentRepository->getLastWeekCount($project_id), 'project' => $project, 'servers' => $project->servers, 'notifications' => $project->notifications, 'notifyEmails' => $project->notifyEmails, 'heartbeats' => $project->heartbeats, 'sharedFiles' => $project->sharedFiles, 'configFiles' => $project->configFiles, 'checkUrls' => $project->checkUrls, 'variables' => $project->variables, 'optional' => $optional, 'tags' => $project->tags()->reverse(), 'branches' => $project->branches(), 'route' => 'commands.step', 'target_type' => 'project', 'target_id' => $project->id]); }