laravel5.6框架中的时间变成多少小时以前的格式

$comment['created_at']->diffForHumans

在app目录里的providers目录的AppServiceProvider.php文件中的boot() 方法添加如下内容

use Carbon\Carbon;

{
    Carbon::setLocale('zh');
}

猜你喜欢

转载自blog.csdn.net/weixin_41767780/article/details/81408206