diff --git a/app/Models/PaymentHash.php b/app/Models/PaymentHash.php index e82845415eab..0839120f5a9a 100644 --- a/app/Models/PaymentHash.php +++ b/app/Models/PaymentHash.php @@ -20,7 +20,6 @@ class PaymentHash extends Model protected $casts = [ 'data' => 'object', ]; - public function invoices() { @@ -41,4 +40,12 @@ class PaymentHash extends Model { return $this->belongsTo(Invoice::class, 'fee_invoice_id', 'id'); } + + public function withData(string $property, $value): PaymentHash + { + $this->data = array_merge((array) $this->data, [$property => $value]); + $this->save(); + + return $this; + } }