【发布时间】:2017-12-04 14:37:37
【问题描述】:
所以目前我拉回一个日期并将其转换为可读的碳格式:
</div>
<div class="">
<label for="Name">Letter Sent:</label>
@if (is_null($Client->letter_posted))
@else
{{ \carbon\carbon::createFromFormat('Y-m-d',$Client->letter_posted)->format('d/m/Y')}}
@endif
</div>
它在测试时有效(在 letter_posted 为 null 和不为 null 时同时测试)但是偶尔它会在实时服务器上吐出错误:
Class 'carbon\carbon' not found
在过去 2 个月内仅随机发生 3 次,刷新页面将消除此错误,例如。出现错误,如果您刷新页面,它不再存在。
任何帮助表示赞赏。
【问题讨论】:
标签: php laravel laravel-5.5 php-carbon