K
K
Khaybulla Musaev2016-12-07 18:00:24
Laravel
Khaybulla Musaev, 2016-12-07 18:00:24

Eloquent sets the updated_at property to created_at when instantiating the model, not NULL. How to fix it?

Previously, when a class instance was created, the updated_at property was automatically set to null. Now useful to look - all properties are equal to created_at (unix_timestamp). What kind of joke, no one knows?.. Maybe I knocked down the settings somewhere?.. Or are these "positive changes" rolled up with the library update?..

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Osher, 2016-12-07
@musaev_haybulla

Previously, when a class instance was created, the updated_at property was automatically set to null.

Didn't work with Laravel 4, but it's always been like this in Laravel 5. updated_at is set on creation.
source .
How to fix?
Turn off $timestamps in the model. Write your own logic for these fields.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question