HTML:
Controller:
Page error:
Then, I just need to redefine a variable, like this Controller:
So, I don’t understand why laravel makes an error when assigning created_at or updated_time in the controller. Help Me!
业精于勤,荒于嬉;行成于思,毁于随。
The system classifies created_at、updated_at、deleted_at字段格式化为了CarbonCarbon.
created_at
updated_at
deleted_at
CarbonCarbon
// 例子 $posts->created_at->timestamp; // 时间戳 $posts->created_at->format('Y-m-d H:i:s'); // 返回指定格式 // Carbon支持很多操作
About CarbonCarbon的了解,可访问官网:http://carbon.nesbot.com/ (绝对推荐使用)
绝对推荐使用
Please post the complete code.
要用Carbon$post->updated_time = Carbon::now();$post->updated_time = Carbon::parse('2017-01-01');$post->updated_time = Carbon::createFromTimestamp(1491747387);
The system classifies
created_at
、updated_at
、deleted_at
字段格式化为了CarbonCarbon
.Please post the complete code.
要用Carbon
$post->updated_time = Carbon::now();
$post->updated_time = Carbon::parse('2017-01-01');
$post->updated_time = Carbon::createFromTimestamp(1491747387);