Question : insert timestamps manually in laravel
Answered by : mohammad-arman-ali
// if you would set local timezon otherwise skip this
$timezone = "Asia/Dhaka";
date_default_timezone_set($timezone);
// insert created_at value manually
DB::table('table')->insert([ 'key'=> 'value', 'created_at' => date("Y-m-d H:i:s", strtotime('now'))
]);
Source : | Last Update : Thu, 09 Dec 21
Question : laravel insert timestamp now
Answered by : mohamad-shahkhajeh
Information::create([ 'data_now'=>Carbon\Carbon::now()
])
Source : | Last Update : Sat, 29 May 21