首页 > 解决方案 > 我在使用 Laravel 时遇到问题,当我尝试注销用户时,我得到 Method Illuminate\Database\Query\Builder::pullCache 不存在

问题描述

帮助...我最近将 Laravel 从 5.5 升级到 >> 5.6,现在当我注销时,我得到...

论据

方法 Illuminate\Database\Query\Builder::pullCache 不存在。

    /**
     * Handle dynamic method calls into the method.
     *
     * @param  string  $method
     * @param  array   $parameters
     * @return mixed
     *
     * @throws \BadMethodCallException
     */
    public function __call($method, $parameters)
    {
        if (static::hasMacro($method)) {
            return $this->macroCall($method, $parameters);
        }

        if (Str::startsWith($method, 'where')) {
            return $this->dynamicWhere($method, $parameters);
        }

        throw new BadMethodCallException(sprintf(
            'Method %s::%s does not exist.', static::class, $method
        ));
    }
}

标签: phplaravellaravel-5.6

解决方案


在 5.6 中像这样使用注销

<a href="{{ route('logout') }}"
onclick="event.preventDefault();
document.getElementById('logout-form').submit();">
<i class="demo-pli-unlock icon-lg icon-fw"></i>
Logout
</a>

推荐阅读