mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-09-03 05:41:07 +00:00
33 lines
636 B
PHP
33 lines
636 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class PaymentAllocation extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'amount' => 'integer',
|
|
'base_amount' => 'integer',
|
|
];
|
|
}
|
|
|
|
public function payment(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Payment::class);
|
|
}
|
|
|
|
public function invoice(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Invoice::class);
|
|
}
|
|
}
|