Laravel 5.1 Update message but it touch both created_at and updated_at

313 Views Asked by At

As title, after update message using code below:

$id = 1;
$message ="Updated";
Post::where(['id' => $id])->update(['message' => $message]);

both created_at and updated_at change to current timestamp.

how to make it update timestamp only updated_at and dont update timestamp at created_at when using update?

Thanks

1

There are 1 best solutions below

1
On BEST ANSWER

Your created_at column is probably set to be auto-updated.