REBELinBLUE\Deployer\Contracts\Repositories\DeploymentRepositoryInterface::getLatest PHP Method

getLatest() public method

public getLatest ( integer $project_id, integer $paginate = 15 ) : Illuminate\Database\Eloquent\Collection
$project_id integer
$paginate integer
return Illuminate\Database\Eloquent\Collection
    public function getLatest($project_id, $paginate = 15);

Usage Example

 /**
  * 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]);
 }