I found this answer on the subject, but it doesn't work for me.
So, I make an entry in the database:
// Write lead to database $lead = Lead::create($lead_data);
And the timestamps look like this, which is good:
| 2016-01-08 10:34:15 | 2016-01-08 10:34:15 |
But then I make a request to an external server, and I need to update the row:
$lead->user_id = $response['user_id']; $lead->broker_id = $response['broker_id']; $lead->save();
and the created_at field gets changed:
| 2016-01-08 04:34:17 | 2016-01-08 10:34:17 |
How do I solve this problem?
I need a solution that would just modify the behavior without dropping columns or resetting migrations. The fix has to be performed on a live database without touching the data. As suggested below, I tried the following migration:
but nothing happens. The created_at field still gets modified on update.