Here is what I want to do, when a new row is created, the updated_at
column should get a null
value and when that row gets updated, the column should be filled with current timestamp
Schema::create('city', function (Blueprint $table) {
$table->increments('id');
$table->string('name')->unique();
$table->enum('visibilty', ['Visible', 'Invisible'])->default('Invisible');
$table->string('created_by')->nullable();
$table->softDeletes();
$table->dateTime('created_at')->default(\DB::raw('DATETIME'));
$table->timestamp('updated_at')->default(\DB::raw('CURRENT_TIMESTAMP'));
});