Add withData() to PaymentHash
This commit is contained in:
parent
7dd7a6e4b1
commit
2501654fec
1 changed files with 8 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue