<?php
 namespace App\Models; use App\Traits\HasTranslations; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\HasMany; class ProductConfigOptionValue extends Model { use HasFactory, HasTranslations; protected $fillable = [ 'option_id', 'value', 'order', 'status', 'passthrough_value', 'is_default', ]; protected $casts = [ 'order' => 'integer', 'status' => 'boolean', 'is_default' => 'boolean', ]; protected $translatable = ['value']; public function option(): BelongsTo { return $this->belongsTo(ProductConfigOption::class, 'option_id'); } public function pricing(): HasMany { return $this->hasMany(Pricing::class, 'relation_id')->where('type', 'product_config'); } } 