Files
law-api/app/Models/Folder.php
2026-07-14 00:24:30 +03:30

37 lines
922 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Folder extends Model
{
use HasFactory;
protected $fillable = [
'user_id',
'name',
];
public function arts()
{
return $this->belongsToMany(Art::class, 'folder_art')->withTimestamps();
}
public function bylaws()
{
return $this->belongsToMany(BylawDocument::class, 'folder_bylaw', 'folder_id', 'bylaw_document_id')->withTimestamps();
}
public function judicialPrecedents()
{
return $this->belongsToMany(JudicialPrecedent::class, 'folder_judicial_precedent', 'folder_id', 'judicial_precedent_id')->withTimestamps();
}
public function legalOpinions()
{
return $this->belongsToMany(LegalOpinion::class, 'folder_legal_opinion', 'folder_id', 'legal_opinion_id')->withTimestamps();
}
}