public static function user(array $authConfig, $username)
    {
        $model = $authConfig['model'];
        $fields = static::getFields($authConfig);

        if (is_array($fields) && count($fields) == 2) {
            return $model::where($fields[0], $username)->orWhere($fields[1], $username)->first();
        }

        return $model::where($fields[0], $username)->first();
    }