belongsTo('App\Models\Shop\Article'); } public function article_family() { return $this->belongsTo('App\Models\Shop\ArticleFamily'); } public function generic() { return $this->belongsTo('App\Models\Shop\PriceGeneric', 'price_generic_id'); } public function generic_prices() { } public function scopeByArticle($query, $id) { return $query->where('article_id', $id); } public function scopeByArticleFamily($query, $id) { return $query->where('article_family_id', $id); } public function scopeGeneric($query) { return $query->whereNotNull('price_generic_id'); } public function scopeNotGeneric($query) { return $query->whereNull('price_generic_id'); } }