wyyl/beike/Models/ProductAttribute.php

33 lines
754 B
PHP

<?php
/**
* AttributeValueDescription.php
*
* @copyright 2023 beikeshop.com - All Rights Reserved
* @link https://beikeshop.com
* @author TL <mengwb@guangda.work>
* @created 2023-01-03 20:22:18
* @modified 2023-01-03 20:22:18
*/
namespace Beike\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class ProductAttribute extends Base
{
use HasFactory;
protected $fillable = ['product_id', 'attribute_id', 'attribute_value_id'];
public function attribute(): BelongsTo
{
return $this->belongsTo(Attribute::class);
}
public function attributeValue(): BelongsTo
{
return $this->belongsTo(AttributeValue::class);
}
}