我已经安装了Laravel Passport,遵循了来自多个网站的所有说明,但我无法使其正常运行。
当我调用中间件auth:api时,我一直收到相同的错误。
ErrorException (E_WARNING)
Illegal offset type
在此行的防护方法上的AuthManager类中出现错误
public function guard($name = null)
{
$name = $name ?: $this->getDefaultDriver();
return $this->guards[$name] ?? $this->guards[$name] = $this->resolve($name);
}
发布于 2019-03-08 20:49:17
这可能意味着您没有正确配置auth
中间件。
Http/Kernel.php
使用中间件Passport定义了一些路由(这是Laravel的默认设置),因此请检查您是否在Passport上有它们。
如果没有,您可以使用缺省的中间件配置:https://github.com/laravel/laravel/blob/5.7/app/Http/Kernel.php#L54
https://stackoverflow.com/questions/54151734
复制相似问题