Level 2
This might work:
{{ Carbon\Carbon::parse($user->time)->diffForHumans() }}
You will want to check out Carbon: http://carbon.nesbot.com/
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello, Is it possible to adjust values such as:
'time'=> 'date_format:H:i|max:140',
'timend'=> 'date_format:H:i|max:140',
'date'=> 'required|date_format:Y-m-d',
'datend'=> 'required|date_format:Y-m-d',
within my view into more User-friendly formats?
View
{{$user->time}}
will result in e.g. 12:00:00
Is there something like: created_at->diffForHumans() for the formats I am using? Thank you
This might work:
{{ Carbon\Carbon::parse($user->time)->diffForHumans() }}
You will want to check out Carbon: http://carbon.nesbot.com/
Please or to participate in this conversation.