0

I am having this error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'deleted_at' in 'where clause' (SQL: select * from `events` where `events`.`deleted_at` is null)

I didn't create a deleted_at column in that table but Laravel is looking for that column, how can I disable that?

Thanks!

PinoyStackOverflower
  • 5,214
  • 18
  • 63
  • 126
  • 6
    Does this answer your question? [Laravel still expects to find deleted\_at column after I remove softDelete](https://stackoverflow.com/questions/48478645/laravel-still-expects-to-find-deleted-at-column-after-i-remove-softdelete) – SergkeiM Jan 07 '20 at 12:21
  • https://stackoverflow.com/questions/48478645/laravel-still-expects-to-find-deleted-at-column-after-i-remove-softdelete?answertab=oldest#tab-top – Harpal Singh Jan 07 '20 at 12:31

3 Answers3

8

Remove the trait from your App\Event model:

use SoftDeletes;

From the docs:

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

Foued MOUSSI
  • 4,643
  • 3
  • 19
  • 39
2

Perhaps you haven't removed the soft delete trait from your model (Event class):

use SoftDeletes;
Tarus
  • 126
  • 6
0

What does your Eloquent query look like? Are you using SoftDeletes? If not the above solutions are what you are looking for.

If you are using SoftDelete trait and have all columns in place then:
I had the same issue when I used the from method on my model. There is also an issue on GitHub when using the from method.
My solution was to re-write my query without from.

Hmerman6006
  • 1,622
  • 1
  • 20
  • 45