将 diffForHumans 与 strototime 结合使用

Using diffForHumans with strototime

我正在尝试将 diffForHumans 与字符串格式的日期一起使用。我使用 strtotime 将字符串转换为 Unix 时间戳。现在的问题是我收到一个无法将整数转换为时间的错误。我错过了什么?

这是我的代码。

<td>{{strtotime($user['scan'])->diffForHumans(time())}}</td>

$user['scan'] 是一个字符串的日期

使用解析。默认情况下,日期与当前时间进行比较。

<td>{{ \Carbon\Carbon::parse($user['scan'])->diffForHumans() }}</td>