IlluminateDatabaseQueryException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'updated_at' in 'field list' 1

Illuminate\Database\QueryException: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘updated_at’ in ‘field list’

class ABC extends Model {
//to turn of just one field
const UPDATED_AT = null;
//to turn off timestamp completely
public $timestamps = false;

Here is what the above code is Doing:
1. The UPDATED_AT constant is set to null. This will prevent the updated_at column from being updated.
2. The $timestamps property is set to false. This will prevent both the created_at and updated_at columns from being updated.

Similar Posts