first
This commit is contained in:
52
src/app/Models/Payment.php
Normal file
52
src/app/Models/Payment.php
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user