HEX
Server: LiteSpeed
System: Linux server334.web-hosting.com 4.18.0-553.124.4.lve.el8.x86_64 #1 SMP Fri May 15 13:02:13 UTC 2026 x86_64
User: richfield (1256)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: /home/richfield/www/vendor/tcg/voyager/docs/customization/custom-realtionship-attributes.md
# Custom relationship attributes

With Voyager 1.1 you are able to define additional attributes which you can show in a relationship.

For example a `Post` has an `Author` and you want to display the `Users` full-name. To do so, we first need to [define an Accessor](https://laravel.com/docs/eloquent-mutators#defining-an-accessor)

```php
public function getFullNameAttribute()
{
    return "{$this->first_name} {$this->last_name}";
}
```

After that we need to tell Voyager that there is an accessor we want to use:

```php
public $additional_attributes = ['full_name'];
```

Thats it! You can now select `full_name` in your Relationship.