How to display 1 day ago in comments in laravel view

Created at 06-Aug-2021 , By samar

How to display 1 day ago in comments in laravel view

We’ll attempt to use programming in this lesson to solve the "How to display 1 day ago in comments in laravel view" puzzle.

You can display the date or time (Ex. 1 day ago, 23 hours ago) in comments at the time of comment has been created on a post in laravel view.
  • DiffForHumans() method on created_at in laravel view

    {{ $comment->created_at->diffForHumans() }}
    
    //output 
    23 hours ago
    

    You can display the time (1 day ago, or 23 hours ago) at the comment that has been created or commented on a post in laravel using the diffForHumans() method on carbon.

Back to code snippet queries related laravel

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Buy Me A Coffee

Don't forget to share this article! Help us spread the word by clicking the share button below.

We appreciate your support and are committed to providing you valuable and informative content.

We are thankful for your never ending support.