forked from admin/services_core
Giant Update
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class TopologyLink extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'path_geojson' => 'array',
|
||||
'metadata' => 'array',
|
||||
'installed_at' => 'date',
|
||||
];
|
||||
}
|
||||
|
||||
public function tenant()
|
||||
{
|
||||
return $this->belongsTo(Tenant::class);
|
||||
}
|
||||
|
||||
public function sourceNode()
|
||||
{
|
||||
return $this->belongsTo(TopologyNode::class, 'source_node_id');
|
||||
}
|
||||
|
||||
public function targetNode()
|
||||
{
|
||||
return $this->belongsTo(TopologyNode::class, 'target_node_id');
|
||||
}
|
||||
|
||||
public function sourcePort()
|
||||
{
|
||||
return $this->belongsTo(TopologyPort::class, 'source_port_id');
|
||||
}
|
||||
|
||||
public function targetPort()
|
||||
{
|
||||
return $this->belongsTo(TopologyPort::class, 'target_port_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user