이렇게 할 경우 에러가 생기는 경우가 있다.

{{($workplan->created_at)->format('m-d')}}


Call to a member function format() on string (View: /Users/wonhochoi/pcb/resources/views/workplan/index.blade.php)



아래와 같이 변경해주면 된다.


{{Carbon\Carbon::parse($workplan->created_at)->format('m-d')}}


'라라벨 > Carbon' 카테고리의 다른 글

날짜 표현방법 알아보기  (0) 2020.01.18
전역변수 날짜, 시간설정하기  (0) 2019.08.31

+ Recent posts