hasMany(Article::class); } public function scopeByArticleNature($query, $id) { return $query->where($this->table . '.id', $id); } public function scopeByBotanic($query); { return $query->where($this->table . '.product_type', 1); } public function scopeByMerchandise($query); { return $query->where($this->table . '.product_type', 2); } public function scopeByProductType($query, $type) { return $query->where($this->table . '.product_type', $type); } }