update
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user