mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
36 lines
856 B
PHP
36 lines
856 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class StatementTransactionOwner extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'statement_transaction_id',
|
|
'type',
|
|
'system',
|
|
'owner_type',
|
|
'owner_id',
|
|
'owner_reference',
|
|
'invoice_reference',
|
|
'receipt_reference',
|
|
'status',
|
|
];
|
|
|
|
public function transaction(): BelongsTo
|
|
{
|
|
return $this->belongsTo(StatementTransaction::class, 'statement_transaction_id', 'id');
|
|
}
|
|
|
|
public function scopeGetSiblingsOwner($query) {
|
|
$query->where('system', $this->system)
|
|
->where('owner_type', $this->owner_type)
|
|
->where('owner_id', $this->owner_id);
|
|
}
|
|
}
|