Laravel error: Call to a member function format() on string

前端 未结 3 1797
心在旅途
心在旅途 2020-12-10 00:52

I am using Laravel 5.3.

There is a field expired_at in table articles

public function store(Request $re         


        
3条回答
  •  不知归路
    2020-12-10 01:39

    I think this is the way. It will not throw error

    {{ Carbon\Carbon::parse($article->expired_at)->format('Y-m-d') }}
    

提交回复
热议问题