binafy/laravel-user-monitoring

Feature request: display custom user attribute instead of only name

elia-c opened this issue · 1 comments

elia-c commented

Add a config option like user\display_attribute = 'display_name'
to use to display instead of only the user name.

With this feature will be possible to do something like append model attribute and use it. Example

class User extends Authenticatable
{
 /**
     * The accessors to append to the model's array form.
     *
     * @var array
     */
    protected $appends = ['displaylabel'];

    /**
     * Attributo composto
     * @return string
     */
    public function getDisplaylabelAttribute()
    {
        return $this->name . ' ' . $this->surname;
    }

}

Hello, This feature will be added soon.
Thanks for making an issue