Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

azamtav's avatar

How to write full name attribute in Laravel 11?

In older versions of Laravel, they provided an example of writing a full name attribute:

/**
 * Get the user's full name.
 *
 * @return string
 */
public function getFullNameAttribute()
{
    return "{$this->first_name} {$this->last_name}";
}

This no longer works in Laravel 11. How do you write the equivalent in Laravel 11?

0 likes
1 reply
umer7's avatar

That should work regardless of the version of Laravel.

Please or to participate in this conversation.