diff --git a/app/Models/Payment.php b/app/Models/Payment.php index 6df4fbc0dbaf..e264482048eb 100644 --- a/app/Models/Payment.php +++ b/app/Models/Payment.php @@ -220,7 +220,7 @@ class Payment extends BaseModel */ public function invoices(): \Illuminate\Database\Eloquent\Relations\MorphToMany { - return $this->morphedByMany(Invoice::class, 'paymentable')->withTrashed()->withPivot('amount', 'refunded')->withTimestamps(); + return $this->morphedByMany(Invoice::class, 'paymentable')->withTrashed()->withPivot('amount', 'refunded', 'deleted_at')->withTimestamps(); } /** @@ -228,7 +228,7 @@ class Payment extends BaseModel */ public function credits(): \Illuminate\Database\Eloquent\Relations\MorphToMany { - return $this->morphedByMany(Credit::class, 'paymentable')->withTrashed()->withPivot('amount', 'refunded')->withTimestamps(); + return $this->morphedByMany(Credit::class, 'paymentable')->withTrashed()->withPivot('amount', 'refunded', 'deleted_at')->withTimestamps(); } /**