This commit is contained in:
Saufi
2026-06-16 15:04:58 +08:00
commit 77a87fbdf1
171 changed files with 21225 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Payment extends Model
{
use HasFactory;
protected $fillable = [
'installment_application_id',
'installment_schedule_id',
'user_id',
'transaction_no',
'receipt_no',
'biller_code',
'ref_1',
'ref_2',
'amount',
'status',
'payload',
'paid_at',
'remarks',
];
protected function casts(): array
{
return [
'amount' => 'decimal:2',
'payload' => 'array',
'paid_at' => 'datetime',
];
}
public function application(): BelongsTo
{
return $this->belongsTo(InstallmentApplication::class, 'installment_application_id');
}
public function schedule(): BelongsTo
{
return $this->belongsTo(InstallmentSchedule::class, 'installment_schedule_id');
}
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
}