28 lines
563 B
PHP
28 lines
563 B
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class HoldingEntityRelation extends Model
|
|
{
|
|
protected $guarded = ['id'];
|
|
|
|
protected $casts = [
|
|
'is_active' => 'boolean',
|
|
'meta' => 'array',
|
|
'contract_start_date' => 'date',
|
|
'contract_end_date' => 'date',
|
|
];
|
|
|
|
public function ownerEntity()
|
|
{
|
|
return $this->belongsTo(HoldingEntity::class, 'owner_entity_id');
|
|
}
|
|
|
|
public function relatedEntity()
|
|
{
|
|
return $this->belongsTo(HoldingEntity::class, 'related_entity_id');
|
|
}
|
|
}
|