Try $order->deadline->diffForHumans()
Nov 23, 2015
5
Level 2
[Carbon] how to get a date stored in mysql can be accessed using diffForHumans()
I have a date called 'deadline' which is stored in mysql as timestamp, but when i tried to output it on a view : {{ @order->deadline->diffForHumans() }} It gets error, which said it is not an object. But for {{ @order->created_at->diffForHumans() }} and {{ @order->updated_at->diffForHumans() }} both works perfectly. Hope anyone can help me, thanks a lot...
Level 2
thanks for the answers guys, i found one that works : {{ Carbon::createFromTimestamp(strtotime(@order->deadline))->diffForHumans() }}
Please or to participate in this conversation.