Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 2 years ago.
0

fix what ?

Last updated 2 years ago.
0

This supposed to happen.

What else did you expect?

Last updated 2 years ago.
0

If you don't want it to happen, you can disable it per model. Don't know why you'd do that though.

Last updated 2 years ago.
0

Sorry. I expected that a record was created. And then when the record was edited, updated_at would be changed.

Thought I was doing something wrong.

Last updated 2 years ago.
0

You could config to do this directly in your schema database and not eloquent.

  • created_at as TIMESTAMP and CURRENT_TIMESTAMP as default value;
  • updated_at as TIMESTAMP and ON UPDATE CURRENT_TIMESTAMP as attribute;
Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

jerauf jerauf Joined 16 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.