AttributeValue.php 636 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace App\Shop\AttributeValues;
  3. use App\Shop\Attributes\Attribute;
  4. use App\Shop\ProductAttributes\ProductAttribute;
  5. use Illuminate\Database\Eloquent\Model;
  6. class AttributeValue extends Model
  7. {
  8. protected $fillable = [
  9. 'value'
  10. ];
  11. /**
  12. * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
  13. */
  14. public function attribute()
  15. {
  16. return $this->belongsTo(Attribute::class);
  17. }
  18. /**
  19. * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
  20. */
  21. public function productAttributes()
  22. {
  23. return $this->belongsToMany(ProductAttribute::class);
  24. }
  25. }