在删除softDelete之后

在删除softDelete之后

本文介绍了在删除softDelete之后,Laravel仍然希望找到delete_at列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过这种迁移,我刚刚从表中删除了softDelete:

I just removed softDelete from a table with this migration:

   Schema::table("items", function ($table) {
      $table->dropSoftDeletes();
   });

但是现在每个查询的结果是:

But now every query results in:

Column not found: 1054 Unknown column 'items.deleted_at' in 'where clause'

代码在任何地方均未明确引用此列.它是否已缓存在某个地方?如果是,如何清除它?

Nowhere does the code explicitly refer to this column. Has it been cached somewhere, and if so, how to clear it?

推荐答案

您还需要从模型中删除特征:

You also need to remove the trait from the model:

use SoftDeletes;

来自文档:

这篇关于在删除softDelete之后,Laravel仍然希望找到delete_at列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 14:32