Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel still expects to find deleted_at column after I remove 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?

like image 831
Dan Avatar asked Jan 27 '18 17:01

Dan


1 Answers

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

like image 163
Alexey Mezenin Avatar answered Nov 15 '22 10:11

Alexey Mezenin