<?php
 namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; class ClientProductConfigOptionValue extends Model { use HasFactory; protected $fillable = [ 'product_id', 'group_id', 'option_id', 'value', ]; public function product(): BelongsTo { return $this->belongsTo(ClientProduct::class, 'product_id'); } public function group(): BelongsTo { return $this->belongsTo(ProductConfigOptionGroup::class, 'group_id'); } public function option(): BelongsTo { return $this->belongsTo(ProductConfigOption::class, 'option_id'); } public function selectedValue(): BelongsTo { return $this->belongsTo(ProductConfigOptionValue::class, 'value'); } } 