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

Check in the model class if have

$timestamps = false

You need to remove it or set to true. and if in the migration in the schema builder you have used

$table->timestamps();
Last updated 2 years ago.
0

The model had no mention of $timestamps so I'd added this:

public $timestamps = true;

And the table was built with a migration containing

$table->timestamps();
Last updated 2 years ago.
0

Does anyone have any other ideas?

Last updated 2 years ago.
0

Can you give us some code examples that aren't causing the timestamps to be updated?

Are they created initially when you use something like Model::create?

Last updated 2 years ago.
0

THAT WAS IT!

I wasn't using Model::create I was doing...

DB::table('cars')->insert(... etc...

Thank you for your reply Jason. This really had me stumped.

Last updated 2 years ago.
0

In my case, I had to manually add public $timestamps = true;

to all Eloquent Models

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

neon5 neon5 Joined 21 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.