Laravel still expects to find deleted_at column after I remove softDelete

荒凉一梦 提交于 2020-07-30 06:07:26

问题


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?


回答1:


You also need to remove the trait from the model:

use SoftDeletes;

From the docs:

To enable soft deletes for a model, use the Illuminate\Database\Eloquent\SoftDeletes trait on the model



来源:https://stackoverflow.com/questions/48478645/laravel-still-expects-to-find-deleted-at-column-after-i-remove-softdelete

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!