Add custom columns to models
// User model
class User extends Authenticatable
{
/**
* Return the full_name by concatinating
* the first_name . ' ' . last_name
*
* @return String
*/
function getFullNameAttribute() {
return sprintf('%s %s', $this->first_name, $this->last_name);
}
}
// Usage
User::first()->full_name;