updates for exposing pivot deleted_at column

This commit is contained in:
David Bomba 2023-10-06 14:23:32 +11:00
parent f768932b4b
commit 81098bb33f

View File

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