返回

php-在Laravel中单击用户配置文件时未找到列错误

发布时间:2022-04-22 15:55:55 212
# 后端

我有个错误:

SQLSTATE[42S22]:未找到列:1054未知列“字段列表”更新中的“两个因素”已确认users设置two_factor_confirmed_at= ?,users.updated_at=2022-04-19 08:58:35其中id = 1

当我在我的Laravel页面中打开用户/配置文件时。我已经在迁移代码中运行了php artisan migrate,其中包含以下内容:

public function up()
{
    Schema::table('users', function (Blueprint $table) {
        $table->text('two_factor_secret')
                ->after('password')
                ->nullable();

        $table->text('two_factor_recovery_codes')
                ->after('two_factor_secret')
                ->nullable();

        if (Fortify::confirmsTwoFactorAuthentication()) {
            $table->timestamp('two_factor_confirmed_at')
                    ->after('two_factor_recovery_codes')
                    ->nullable();
        }
    });
}

/**
 * Reverse the migrations.
 *
 * @return void
 */
public function down()
{
    Schema::table('users', function (Blueprint $table) {
        $table->dropColumn(array_merge([
            'two_factor_secret',
            'two_factor_recovery_codes',
        ], Fortify::confirmsTwoFactorAuthentication() ? [
            'two_factor_confirmed_at',
        ] : []));
    });
}

谢谢你的帮助,谢谢。

特别声明:以上内容(图片及文字)均为互联网收集或者用户上传发布,本站仅提供信息存储服务!如有侵权或有涉及法律问题请联系我们。
举报
评论区(0)
按点赞数排序
用户头像