Adldap\Laravel\Traits\AuthenticatesUsers::getLoginUsernameFromUser PHP Method

getLoginUsernameFromUser() public method

Retrieves the configured login username from the LDAP user.
public getLoginUsernameFromUser ( User $user ) : string
$user Adldap\Models\User
return string
    public function getLoginUsernameFromUser(User $user)
    {
        $username = $user->{$this->getLoginAttribute()};
        if (is_array($username)) {
            // We'll make sure we retrieve the users first username
            // attribute if it's contained in an array.
            $username = array_get($username, 0);
        }
        return $username;
    }