JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr{ gilour

File "HasDisplayNameAttribute.php"

Full Path: /home/markqprx/iniasli.pro/Auth/Traits/HasDisplayNameAttribute.php
File size: 652 bytes
MIME-type: text/x-php
Charset: utf-8

<?php

namespace Common\Auth\Traits;

trait HasDisplayNameAttribute
{
    /**
     * Compile user display name from available attributes.
     *
     * @return string
     */
    public function getDisplayNameAttribute()
    {
        if ($this->username) {
            return $this->username;
        } else if ($this->first_name && $this->last_name) {
            return $this->first_name.' '.$this->last_name;
        } else if ($this->first_name) {
            return $this->first_name;
        } else if ($this->last_name) {
            return $this->last_name;
        } else {
            return explode('@', $this->email)[0];
        }
    }
}