Support the ongoing development of Laravel.io →
Database Eloquent Architecture
Last updated 4 months ago.
0

So you don't want the created_at and updated_at columns to be automatically treated as dates and converted into Carbon instances?

If so you'll have to override the getDates method as it's responsible for merging in your custom dates with the defaults.

public function getDates()
{
    return [];
}
Last updated 4 months ago.
0

Yes, it's this. I just figured it out after reading the Eloquent\Model class code. Since I don't use updated_at I just removed it from the code:

public function getDates() {
	$defaults = array(static::UPDATED_AT);
	return array_merge($this->dates, $defaults);
}

But for the same reason, returning other than empty array is useless. Thanks :)

Last updated 4 months ago.
0

Sign in to participate in this thread!

Full Stack Europe

Your banner here too?

ranisalt ranisalt Joined 10 Feb 2014

Moderators

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

Your logo here?

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

© 2022 Laravel.io - All rights reserved.