53 lines
1.0 KiB
PHP
53 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Models\Shop;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
use Rinvex\Categories\Traits\Categorizable;
|
|
use Conner\Tagging\Taggable;
|
|
|
|
class Article extends Model
|
|
{
|
|
use Categorizable;
|
|
use Taggable;
|
|
|
|
protected $guarded = ['id'];
|
|
protected $table = 'shop_articles';
|
|
|
|
public function Family()
|
|
{
|
|
return $this->belongsTo('App\Models\Shop\Family');
|
|
}
|
|
|
|
public function Inventories()
|
|
{
|
|
return $this->hasMany('App\Models\Shop\Inventory');
|
|
}
|
|
|
|
public function Prices()
|
|
{
|
|
return $this->hasMany('App\Models\Shop\ArticlePrice');
|
|
}
|
|
|
|
public function ArticleAttributes()
|
|
{
|
|
return $this->hasMany('App\Models\Shop\ArticleAttribute');
|
|
}
|
|
|
|
public function Categories()
|
|
{
|
|
return $this->hasMany('App\Models\Shop\ArticleCategory');
|
|
}
|
|
|
|
public function InvoiceItems()
|
|
{
|
|
return $this->hasMany('App\Models\Shop\InvoiceItem');
|
|
}
|
|
|
|
public function Product()
|
|
{
|
|
return $this->belongsTo($this->model, 'model_id');
|
|
}
|
|
|
|
} |