我有一个问题updated_at,created_at在Laravel 5中的字段.
这是我的迁移:
Schema::create('lots', function (Blueprint $table) {
$table->increments('id');
$table->integer('lot');
$table->integer('is_active');
$table->timestamps();
});
Run Code Online (Sandbox Code Playgroud)
但是,当我插入一些数据到这个表中,updated_at并且created_at字段为空.如何使用当前时间戳自动完成它们?
我插入这样的数据:
\DB::table('admin_lots')->insert([
'lot' => $request->cycle_lot,
'is_active' => '1',
]);
Run Code Online (Sandbox Code Playgroud)
谢谢.