[WIP] Refactor architecture, models

This commit is contained in:
Ludovic CANDELLIER
2020-04-22 01:26:03 +02:00
parent e370174f94
commit a18d30b65c
39 changed files with 446 additions and 266 deletions

View File

@@ -0,0 +1,47 @@
<?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 ProductAttributes()
{
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');
}
}