@GoldeNx3 Instead of having a separate values table, add a value column on your attribute–offer pivot table:
$table->primary(['attribute_id', 'offer_id', 'value']);
$table->unsignedInteger('attribute_id');
$table->unsignedInteger('offer_id');
$table->string('value');
$table->i
You can then load attributes and their values from a relation on your Offer model:
class Offer extends Model
{
public function attributes()
{
return $this->belongsToMany(Attribute::class)->withPivot('value');
}
}
<dl>
@foreach($offer->attributes as $attribute)
<dt>{{ $attribute->name }}</dt>
<dd>{{ $attribute->pivot->value }}</dd>
@endforeach
</dl>