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