Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eloquent:Invalid column name 'updated_at'

I'm new to PHP/Laravel.

My model extends the default Model class.

class LobModel extends Model
class AlarmActions extends LobModel

When I try to update a row in AlarmActions table; I'm getting

SQLSTATE[42S22]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid column name 'updated_at'. (SQL: update [AlarmActions] set [AlarmActionDescription] = sdsf, [UTCDateTimeUpdated] = 2017-08-11 00:42:05.000, [updated_at] = 2017-08-11 00:42:05.000 where [AlarmActionId] = 19621)

I do not have column updated_at defined in my AlarmActions table.

But I see, in the default Model class following columns are defined. How can I skip those two columns?

const UPDATED_AT = 'updated_at';
const CREATED_AT = 'created_at';

Im' calling save method to update a row.

 $alarmAction->save();
like image 343
Ratha Avatar asked Jan 30 '23 19:01

Ratha


1 Answers

Add

public $timestamps = false;

to your AlarmActions model

like image 165
chanafdo Avatar answered Feb 03 '23 08:02

chanafdo