'decimal:2', 'fee' => 'decimal:2', 'status' => \App\Enums\InvoiceTransactionStatus::class, ]; public function invoice() { return $this->belongsTo(Invoice::class); } public function gateway() { return $this->belongsTo(Gateway::class); } /** * Formatted remaining amount of the invoice. */ public function formattedFee(): Attribute { return Attribute::make( get: fn () => new Price(['price' => $this->fee, 'currency' => $this->invoice->currency]) ); } /** * Formatted remaining amount of the invoice. */ public function formattedAmount(): Attribute { return Attribute::make( get: fn () => new Price(['price' => $this->amount, 'currency' => $this->invoice->currency]) ); } }