Add relations in tables, add saving states for datatables, minor fixes
This commit is contained in:
@@ -40,11 +40,6 @@ class Article extends Model implements HasMedia
|
||||
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');
|
||||
@@ -60,6 +55,11 @@ class Article extends Model implements HasMedia
|
||||
return $this->morphTo();
|
||||
}
|
||||
|
||||
public function tags()
|
||||
{
|
||||
return $this->morphToMany('App\Models\Shop\Tag', 'taggable');
|
||||
}
|
||||
|
||||
public function scopeByArticle($query, $id)
|
||||
{
|
||||
return $query->where($this->table . '.id', $id);
|
||||
|
||||
Reference in New Issue
Block a user