public function abortQueued($project_id)
{
$deployments = $this->model->where('project_id', $project_id)->whereIn('status', [Deployment::DEPLOYING, Deployment::PENDING])->orderBy('started_at', 'DESC')->get();
foreach ($deployments as $deployment) {
$deployment->status = Deployment::ABORTING;
$deployment->save();
$this->dispatch(new AbortDeployment($deployment));
if ($deployment->is_webhook) {
$deployment->delete();
}
}
}