This commit is contained in:
tanch0
2024-06-23 17:02:56 +05:45
parent 25760ad989
commit f85671cd4c
93 changed files with 2886 additions and 1579 deletions

View File

@ -89,4 +89,12 @@ class News extends Model
public function provinces(): BelongsTo{
return $this->belongsTo(Provinces::class, 'provinces_id', 'province_id');
}
public function comments()
{
return $this->hasMany(Comments::class, 'news_id', 'news_id')->with('subcomments')
->where('parent_id', 0)
->orWhere('parent_id', null)
->where('status', 1);
}
}