33 lines
578 B
PHP
33 lines
578 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class TransactionPayment extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'transaction_payments';
|
|
|
|
protected $fillable = [
|
|
'transaction_id',
|
|
'amount',
|
|
'status',
|
|
'method_type',
|
|
'method_id'
|
|
];
|
|
|
|
public function transaction()
|
|
{
|
|
return $this->belongsTo(Transaction::class, 'transaction_id', 'id');
|
|
}
|
|
|
|
|
|
public function method()
|
|
{
|
|
return $this->morphTo();
|
|
}
|
|
}
|