belongsTo(AttributeProxy::modelClass()); } /** * Get image url for the swatch value url. */ public function swatch_value_url() { if ($this->swatch_value && $this->attribute->swatch_type == 'image') return Storage::url($this->swatch_value); return; } /** * Get image url for the product image. */ public function getSwatchValueUrlAttribute() { return $this->swatch_value_url(); } }