Bien. Campos created_at
,update_at
y deleted_at
son "parte" de Eloquent
. Usas Query Builder
=> la inserción no afecta estos dos campos (created_at
y updated_at
). Debe definirlo manualmente como:
$id = DB::table('widgets')
->insertGetId(array(
'creator' => Auth::user()->id,
'widget_name' => $request->input('widget_name'),
'pages' => json_encode($request->input('pages')),
'domain' => $request->input('domain'),
"settings" => $settings,
"created_at" => \Carbon\Carbon::now(), # new \Datetime()
"updated_at" => \Carbon\Carbon::now(), # new \Datetime()
));