From 291b45fc679e55193d196e497eb31f682aa078ca Mon Sep 17 00:00:00 2001 From: "Harry (hjbdev)" Date: Mon, 31 Mar 2025 16:21:56 +0000 Subject: [PATCH] relationship fix --- app/Jobs/Services/RunStep.php | 4 ++-- app/Models/Deployment.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Jobs/Services/RunStep.php b/app/Jobs/Services/RunStep.php index 7800628..2986c7b 100644 --- a/app/Jobs/Services/RunStep.php +++ b/app/Jobs/Services/RunStep.php @@ -21,13 +21,13 @@ class RunStep implements ShouldQueue public function handle(): void { - $this->step->load('service.server'); + $this->step->load('deployment.target.server'); $this->step->update([ 'status' => DeploymentStatus::IN_PROGRESS, 'started_at' => now(), ]); - $server = $this->step->service->server; + $server = $this->step->deployment->target->server; $ssh = Ssh::create('root', $server->ipv4) ->usePrivateKey(storage_path('private/ssh/id_ed25519')) diff --git a/app/Models/Deployment.php b/app/Models/Deployment.php index 66929a9..c4552f4 100644 --- a/app/Models/Deployment.php +++ b/app/Models/Deployment.php @@ -23,7 +23,7 @@ class Deployment extends Model return $this->hasMany(Step::class); } - public function deployable(): MorphTo + public function target(): MorphTo { return $this->morphTo('target'); }