Attributes
This commit is contained in:
@@ -30,7 +30,7 @@ class Article extends Model
|
||||
return $this->hasMany('App\Models\Shop\ArticlePrice');
|
||||
}
|
||||
|
||||
public function ProductAttributes()
|
||||
public function ArticleAttributes()
|
||||
{
|
||||
return $this->hasMany('App\Models\Shop\ArticleAttribute');
|
||||
}
|
||||
|
||||
@@ -6,13 +6,13 @@ use Illuminate\Database\Eloquent\Relations\Pivot;
|
||||
|
||||
class ArticleAttribute extends Pivot
|
||||
{
|
||||
public function Article()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Shop\Article');
|
||||
}
|
||||
public function article()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Shop\Article');
|
||||
}
|
||||
|
||||
public function Attribute()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Shop\ArticleAttribute');
|
||||
}
|
||||
public function value()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Shop\ArticleAttribute');
|
||||
}
|
||||
}
|
||||
17
app/Models/Shop/ArticleAttributeFamily.php
Normal file
17
app/Models/Shop/ArticleAttributeFamily.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Shop;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ArticleAttributeFamily extends Model
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
protected $table = 'shop_article_attribute_families';
|
||||
|
||||
public function Values()
|
||||
{
|
||||
return $this->hasMany('App\Models\Shop\ArticleAttributeValue','attribute_family_id');
|
||||
}
|
||||
|
||||
}
|
||||
16
app/Models/Shop/ArticleAttributeValue.php
Normal file
16
app/Models/Shop/ArticleAttributeValue.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Shop;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ArticleAttributeValue extends Model
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
protected $table = 'shop_article_attribute_values';
|
||||
|
||||
public function attribute_family()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Shop\ArticleAttributeFamily');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user