added foldering apis
This commit is contained in:
@@ -16,6 +16,21 @@ class Folder extends Model
|
||||
|
||||
public function arts()
|
||||
{
|
||||
return $this->belongsToMany(Art::class, 'folder_art');
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
13
app/Models/FolderBylaw.php
Normal file
13
app/Models/FolderBylaw.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class FolderBylaw extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'folder_bylaw';
|
||||
protected $fillable = ['folder_id', 'bylaw_document_id'];
|
||||
}
|
||||
13
app/Models/FolderJudicialPrecedent.php
Normal file
13
app/Models/FolderJudicialPrecedent.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class FolderJudicialPrecedent extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'folder_judicial_precedent';
|
||||
protected $fillable = ['folder_id', 'judicial_precedent_id'];
|
||||
}
|
||||
13
app/Models/FolderLegalOpinion.php
Normal file
13
app/Models/FolderLegalOpinion.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class FolderLegalOpinion extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'folder_legal_opinion';
|
||||
protected $fillable = ['folder_id', 'legal_opinion_id'];
|
||||
}
|
||||
Reference in New Issue
Block a user