Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Laravel: Set timestamp column to current timestamp

<?php

/* For Create */
$table->timestamp('created_at')->useCurrent();

/* For Update */
$table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate();
Source by postsrc.com #
 
PREVIOUS NEXT
Tagged: #Set #timestamp #column #current #timestamp
ADD COMMENT
Topic
Name
1+4 =