feat: add bylaw management features including documents, legal authorities, subject categories, and nodes
This commit is contained in:
27
app/Models/BylawNode.php
Normal file
27
app/Models/BylawNode.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user