DWQA QuestionsCategory: LaravelHow can I set the default value of a timestamp column to the current timestamp with Laravel migrations?
kandy asked 5 years ago

$table->timestamp(‘created_at’)->default(DB::raw(‘CURRENT_TIMESTAMP’));
$table->timestamp(‘updated_at’)->default(DB::raw(‘CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP’));