【发布时间】:2019-06-13 09:19:20
【问题描述】:
我有关于用户的 last_active 字段,我希望使用 Moment.js 中的 diffForHumans 或 time_from_now 显示时间。我该怎么做?现在我只使用:
DateTime::make('Activiy', 'last_active')
->exceptOnForms(),
当我使用时:
DateTime::make('Activiy', 'last_active')->diffForHumans()
->exceptOnForms(),
我得到未定义的方法diffForHumans。
【问题讨论】:
-
也许您没有将
last_active列转换为模型上的日期时间?
标签: php laravel laravel-nova