首页 > 解决方案 > Laravel 5.7 帐户验证电子邮件给出“非法偏移类型”异常

问题描述

我实现了 Laravel 的身份验证。除帐户验证外,一切正常。当我Signup/Regiser收到Account Verification带有verification link. 当我单击提供的链接以验证我的帐户时,我得到了关注Exception

ErrorException (E_WARNING)
Illegal offset type
/var/www/html/myproject/vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php

public function __construct($app)
{
    $this->app = $app;

    $this->userResolver = function ($guard = null) {
        return $this->guard($guard)->user();
    };
}

/**
 * Attempt to get the guard from the local cache.
 *
 * @param  string  $name
 * @return \Illuminate\Contracts\Auth\Guard|\Illuminate\Contracts\Auth\StatefulGuard
 */
public function guard($name = null)
{
    $name = $name ?: $this->getDefaultDriver();

    return $this->guards[$name] ?? $this->guards[$name] = $this->resolve($name);
}

标签: laravelemaillaravel-5.7

解决方案


推荐阅读