fox/app/Models/Fox/FoxMemoryEdge.php

38 lines
780 B
PHP

<?php
namespace App\Models\Fox;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class FoxMemoryEdge extends Model
{
use HasUuids;
protected $table = 'fox_memory_edges';
protected $fillable = [
'source_node_id',
'target_node_id',
'relation',
'strength',
'meta',
];
protected $casts = [
'meta' => 'array',
'strength' => 'float',
];
public function sourceNode(): BelongsTo
{
return $this->belongsTo(FoxMemoryNode::class, 'source_node_id');
}
public function targetNode(): BelongsTo
{
return $this->belongsTo(FoxMemoryNode::class, 'target_node_id');
}
}