diff --git a/app/Person.php b/app/Person.php index bc1957a..2a8e8b2 100644 --- a/app/Person.php +++ b/app/Person.php @@ -126,4 +126,18 @@ class Person extends Model { return $this->hasManyThrough('\App\SubBooking', '\App\PersonTarget'); } + + /* + * Get the full name of the person. + * + * @return string + */ + public function fullName() + { + if ($this->title == 'Firma') { + return $this->name_or_company; + } else { + return $this->surname . ' ' . $this->name_or_company; + } + } }