我取回從我的數據庫此日期格式:2016-09-05T10:24:13Z格式日期與碳和Laravel在一行
我需要得到這個日期,並直接應用diffForHumans()方法的碳。
我有一票的消息聊天時間表:
@foreach($ticket->messages as $msg)
<div class="chat-bubble>
<div class="chat-msg">{{ $msg->message }}</div>
<div class="chat-footer">{{ $msg->creation_date }}</div> //here needs carbon diff
</div>
@endforeach
我怎樣才能在一個代碼行中使用碳在我tickets.blade.php?
$ msg-> creation_date不是一個碳對象... –
{! \ Carbon \ Carbon :: parse($ msg-> creation_date) - > diffForHumans()!!} –