belongsTo('App\Models\Shop\ArticleFamily'); } public function attributes() { return $this->hasMany('App\Models\Shop\ArticleAttribute'); } public function images() { return $this->hasMany('App\Models\Core\Media','model_id')->where('model_type','App\Models\Shop\Article'); } public function image() { return $this->hasOne('App\Models\Core\Media','model_id')->where('model_type','App\Models\Shop\Article'); } public function inventories() { return $this->hasMany('App\Models\Shop\Inventory'); } public function invoiceItems() { return $this->hasMany('App\Models\Shop\InvoiceItem'); } public function prices() { return $this->hasMany('App\Models\Shop\Price'); } public function product() { return $this->morphTo(); } public function scopeByArticle($query, $id) { return $query->where('shop_articles.id',$id); } public function scopeByCategory($query, $category_id) { } public function scopeByFamily($query, $id) { return $query->where('shop_articles.article_family_id',$id); } }