【问题标题】:Column not found when I press the show or update or delete button in my laravel project [closed]当我在我的 laravel 项目中按下显示或更新或删除按钮时找不到列[关闭]
【发布时间】:2022-01-25 14:19:19
【问题描述】:

照亮\数据库\查询异常 SQLSTATE [42S22]:未找到列:1054 'where 子句'中的未知列'surveillants.deleted_at'(SQL:select * from surveillants where id = 11 和 surveillants.deleted_at 为空限制 1)

【问题讨论】:

    标签: php laravel laravel-8


    【解决方案1】:

    您的模型 (use SoftDeletes;) 中似乎启用了软删除,但 surveillants 数据库表中没有 deleted_at 列,没有执行 $table->softDeletes(); 的迁移。

    请阅读https://laravel.com/docs/8.x/eloquent#soft-deleting

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-01-10
      • 1970-01-01
      • 1970-01-01
      • 2016-09-14
      • 2019-11-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多