I have this echo in my blade…
{{ date('H:i:s', strtotime($sale->order_time->setTimezone($venue->timezone))) }}
…and all I get is a “Call to a member function setTimezone() on string” error. This code used to work perfectly before updating Laravel.
The way to declare a timestamp in models changed since Laravel 8. Update in your model from
protected $dates = ['order_time'];
To:
protected $casts = [
'order_time' => 'datetime',
];