feat: add bylaw management features including documents, legal authorities, subject categories, and nodes

This commit is contained in:
2026-06-26 13:49:50 +03:30
parent 2e26bd229b
commit 9cf6957675
113 changed files with 1112 additions and 358 deletions

View File

@@ -0,0 +1,34 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class BylawDocument extends Model
{
protected $table = 'bylaw_documents';
protected $fillable = ['title', 'category_id', 'approval_authority_id', 'approval_date', 'promulgation_authority_id', 'promulgation_date', 'promulgation_number', 'official_gazette_number', 'official_gazette_date', 'execution_date', 'bylaw_type', 'global_status', 'pdf_file_path', 'is_published', 'description'];
protected $casts = ['is_published' => 'boolean'];
public function category()
{
return $this->belongsTo(BylawSubjectCategory::class, 'category_id');
}
public function approvalAuthority()
{
return $this->belongsTo(BylawLegalAuthority::class, 'approval_authority_id');
}
public function promulgationAuthority()
{
return $this->belongsTo(BylawLegalAuthority::class, 'promulgation_authority_id');
}
public function nodes()
{
return $this->hasMany(BylawNode::class, 'document_id');
}
}