O'Reilly logo
  • GIL EG thinks this is interesting:

 <?php

  namespace App;

  use Illuminate\Database\Eloquent\Model;

  class User extends Model {

      public function getCompleteNameAttribute()
    {
        return $this->attributes['first_name']. ' ' . $this->attributes['last_name'];
    }

  }

From

Cover of Learning Laravel's Eloquent

Note

appends attributes