if ($name === '') {
return $this->companyName;
}
- return $this->companyName . ' - ' . $this->name;
+ return $this->companyName . ' (' . $this->name . ')';
}
public function getNameWithCompanyAttribute()
return $name . ' (' . $this->companyName . ')';
}
+ public function getCompanyWithNameOnTwoLinesAttribute()
+ {
+ $name = $this->name;
+ if ($name === '') {
+ return $this->companyName;
+ }
+ $company = $this->companyName;
+ if (mb_strlen($company) > 30) {
+ $company = '<span title="' . $company . '">' . mb_substr($company, 0, 27) . '...</span>';
+ }
+
+ return $company . '<br><em>' . $name . '</em>';
+ }
+
public function getCompanyNameAttribute()
{
return self::_getCompanyNames($this->company);