While creating migrations, you can use timestamp()
column type with option
useCurrent()
and useCurrentOnUpdate()
, it will set CURRENT_TIMESTAMP
as default value.
1$table->timestamp('created_at')->useCurrent();2$table->timestamp('updated_at')->useCurrentOnUpdate();