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 [];
}
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 :)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community