I'm trying to insert date into created at but nothing worked
I tried to use create as normal
$this->create([ 'product_id' => "$id", 'shop_name' => $shop,'created_at' => $date ]);
I tried to change the date format to match laravel
$date = date('Y-m-d H:i:s',strtotime($id['created_at']));
I also tried to user mutators to change the value each time
public function setFirstNameAttribute($value)
{
$this->attributes['created_at'] = $value;
}
How can I set a specific date in created_at
rather than the default date?
API_created_date
andAPI_updated_date
to indicate what they actually hold. More intuitive and no problems updating. If you're not too deep in the project now I suggest you change that – Eustazio