'integer', ]; protected $appends = [ 'display_name', 'display_name_short' ]; protected function displayName() : Attribute{ return Attribute::make( get: function () { return "{$this->manufacturer_code} {$this->model_full_name} ({$this->designator})"; } ); } protected function displayNameShort(): Attribute { return Attribute::make( get: function () { $name = "{$this->manufacturer_code} {$this->model_full_name}"; return trim(preg_replace('/\s*\(.*?\)/', '', $name)); } ); } }