Disable updated_at time of insert

Posted 7 months ago by souvikbhattacharyas

Hi,

In Eloquent model I found created_at and updated_at fields are handled automatically. But updated_at field should be populated at time of Update only but I found that updated_at field also getting populated during insert.

Now I do not want to disable $timestamps = false but only wants to have control over it where created_at field will be populated during INSERT operation and updated_at fields will be populated at time of UPDATE operation.

Please sign in or create an account to participate in this conversation.