belongsTo(ProductProxy::modelClass()); } /** * Get the lead that owns the lead product. */ public function lead() { return $this->belongsTo(LeadProxy::modelClass()); } /** * Get the customer full name. */ public function getNameAttribute() { return $this->product->name; } /** * @return array */ public function toArray() { $array = parent::toArray(); $array['name'] = $this->name; return $array; } }