feat: add bylaw management features including documents, legal authorities, subject categories, and nodes
This commit is contained in:
@@ -9,10 +9,10 @@ class Section extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = ['title', 'number', 'book_id', 'volum_id', 'law_id','division_id'];
|
||||
protected $fillable = ['title', 'number', 'book_id', 'volum_id', 'law_id', 'division_id'];
|
||||
|
||||
protected $hidden = ['created_at', 'updated_at'];
|
||||
|
||||
|
||||
public function chapters()
|
||||
{
|
||||
return $this->hasMany(Chapter::class);
|
||||
@@ -47,17 +47,14 @@ class Section extends Model
|
||||
{
|
||||
return $this->hasMany(Art::class);
|
||||
}
|
||||
|
||||
|
||||
public static function search($searchTerm)
|
||||
{
|
||||
return self::where('title', 'LIKE', "%{$searchTerm}%")->get();
|
||||
}
|
||||
|
||||
|
||||
public static function searchLimit($searchTerm)
|
||||
{
|
||||
return self::where('title', 'LIKE', "%{$searchTerm}%")->limit(3)->get();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user