Answers for "auto timestamp laravel"

PHP
1

laravel turn off timestamps

public $timestamps = false; (In the model which you need to disable)
Posted by: Guest on September-29-2021
0

insert timestamps manually in laravel

// 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'))
]);
Posted by: Guest on December-02-2021

Browse Popular Code Answers by Language