Fix some enhancements & new features

This commit is contained in:
Ludovic CANDELLIER
2020-07-26 16:51:45 +02:00
parent fcd26d13de
commit 1179b5ca31
54 changed files with 975 additions and 341 deletions

View File

@@ -11,40 +11,37 @@ use Fico7489\Laravel\EloquentJoin\Traits\EloquentJoin;
class Article extends Model implements HasMedia
{
use Categorizable;
use Taggable;
use HasMediaTrait;
use EloquentJoin;
use Categorizable, Taggable, HasMediaTrait, EloquentJoin;
protected $guarded = ['id'];
protected $table = 'shop_articles';
public function Family()
public function article_family()
{
return $this->belongsTo('App\Models\Shop\ArticleFamily','article_family_id');
return $this->belongsTo('App\Models\Shop\ArticleFamily');
}
public function Inventories()
public function attributes()
{
return $this->hasMany('App\Models\Shop\ArticleAttribute');
}
public function prices()
{
return $this->hasManyThrough('App\Models\Shop\ArticlePrice','App\Models\Shop\ArticleAttribute');
}
public function inventories()
{
return $this->hasMany('App\Models\Shop\Inventory');
}
public function Prices()
{
return $this->hasMany('App\Models\Shop\ArticlePrice');
}
public function Attributes()
{
return $this->hasManyThrough('App\Models\Shop\ArticleAttribute','App\Models\Shop\ArticlePrice');
}
public function InvoiceItems()
public function invoiceItems()
{
return $this->hasMany('App\Models\Shop\InvoiceItem');
}
public function Product()
public function product()
{
return $this->belongsTo($this->model, 'model_id');
}