Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel add timestamps to existing table

$table->dateTime('created_at')->default(DB::raw('CURRENT_TIMESTAMP'));
$table->dateTime('updated_at')->nullable();
Comment

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'))
]);
Comment

laravel insert timestamp now

Information::create([
  'data_now'=>CarbonCarbon::now()
])
Comment

PREVIOUS NEXT
Code Example
Php :: Fatal error: Uncaught ReflectionException: Class config does not exist in 
Php :: php store log in a text file 
Php :: get first element of array php 
Php :: how to add newline in php 
Php :: tolower php 
Php :: how count the rout in route.php laravel 
Php :: php remove empty values from array 
Php :: woocommerce get user id by email 
Php :: laravel where condition on relationship 
Php :: if value conatins in word check in php 
Php :: increase upload limit in phpmyadmin docker 
Php :: auth guard api is not defined laravel 8 
Php :: oci_execute(): ORA-01810: format code appears twice in 
Php :: php code to display current date and time in different formats 
Php :: twig ternary 
Php :: laravel url previous 
Php :: php prime numbers 
Php :: how to take last entry in database in laravel Method ONe 
Php :: mysql count rows php 
Php :: laravel display error message 
Php :: If a String Contains a Specific Word in PHP 
Php :: update-alternatives java 
Php :: carbon two day ago 
Php :: num_rows in php 
Php :: loop index foreach laravel 
Php :: laravel get db connection info 
Php :: php sqrt 
Php :: laravel join table 
Php :: request get query string laravel 
Php :: laravel base64 decode save file 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =