hasOne('App\Models\Price'); } public function article_family() { return $this->belongsTo('App\Models\ArticleNature'); } public function scopeByQuantity($query, $quantity) { return $query->orderBy('quantity', 'desc')->where('quantity', '<', $quantity)->first(); } public function scopeByFamily($query, $id) { return $query->where('article_family_value_id', $id); } }