如何在 PHP 的 Laravel/Lumen 中显示特定的时间格式?

How to display particular time format in PHP's Laravel/Lumen?

在我看来,我有这段代码:

@foreach ($tickets as $t) {
    <p> {{ $t->updated_at }} </p>
@endforeach

最终产生:

2016-08-18 01:23:45
...

有没有办法达到以下效果:

{{ $note->updated_at("l, h:i A") }}

所以显示的是:Thursday, 01:23 AM

基本上,Eloquent中的date/datetime属性被转换为Carbon对象,所以你可以这样做,

{{ $note->updated_at->format("l, h:i A") }}