Level 1
That should work regardless of the version of Laravel.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
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?
Please or to participate in this conversation.