feat: shows the latest deployment commit + message on status

This commit is contained in:
Andras Bacsai
2024-05-17 08:53:25 +02:00
parent 6131746180
commit 10fde1b1ef
7 changed files with 38 additions and 11 deletions

View File

@@ -454,6 +454,10 @@ class Application extends BaseModel
}
return false;
}
public function get_last_successful_deployment()
{
return ApplicationDeploymentQueue::where('application_id', $this->id)->where('status', 'finished')->orderBy('created_at', 'desc')->first();
}
public function get_last_days_deployments()
{
return ApplicationDeploymentQueue::where('application_id', $this->id)->where('created_at', '>=', now()->subDays(7))->orderBy('created_at', 'desc')->get();