Files
law-api/app/Models/BylawNode.php

28 lines
641 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class BylawNode extends Model
{
protected $table = 'bylaw_nodes';
protected $fillable = ['document_id', 'parent_id', 'node_type_id', 'node_identifier', 'title', 'node_content', 'sort_order', 'valid_from', 'valid_to', 'node_status'];
public function document()
{
return $this->belongsTo(BylawDocument::class, 'document_id');
}
public function parent()
{
return $this->belongsTo(self::class, 'parent_id');
}
public function type()
{
return $this->belongsTo(BylawNodeType::class, 'node_type_id');
}
}