Laravel 5 未定义变量:使用laravel5.2登录时的表

Laravel 5 未定义变量:使用laravel5.2登录时的表,laravel-5,Laravel 5,当我尝试登录时,会出现此错误 ActivationRepository.php第41行中的ErrorException:未定义 变量:表 但用户登录成功,这是正常工作之前,你能看看这个,可能是什么问题 非常感谢您的帮助。创建ActivationFactory.php 台阶 mkdir应用程序/工厂 代码 rote.php Route::get('user/activation/{token}', 'Auth\AuthController@activateUser')->name('user

当我尝试登录时,会出现此错误

ActivationRepository.php第41行中的ErrorException:未定义 变量:表

但用户登录成功,这是正常工作之前,你能看看这个,可能是什么问题


非常感谢您的帮助。

创建ActivationFactory.php

台阶

mkdir应用程序/工厂

代码

rote.php

Route::get('user/activation/{token}', 'Auth\AuthController@activateUser')->name('user.activate');
ActivationFactory.php

在这里添加您的代码

例如,请检查此链接


那么,您需要修改ActivationRepository类

改变这个

private function regenerateToken($user)
    {
        $token = $this->getToken();
        $this->db->table($table)->where('user_id', $user->id)->update([
            'token' => $token,
            'created_at' => new Carbon()
        ]);
        return $token;
    }


希望这有帮助。

您能提供完整的代码吗?请提供您需要的代码,我使用基本的脚手架进行身份验证@DharmeshRakholiaActivationRepository类代码这是第41行和第42行的代码
private function regenerateToken($user)
    {
        $token = $this->getToken();
        // $this->table refers to 'user_activations',btw you can pass table name manually although not recommended.
        $this->db->table($this->table)->where('user_id', $user->id)->update([
            'token' => $token,
            'created_at' => new Carbon()
        ]);
        return $token;
    }