sqlstate(hy000 error 1045) access denied for user laravel

The error SQLSTATE [HY000] [1045] Access denied for user ‘root’@’localhost’ (using password: YES) or (using password: Now) comes in two conditions, The first is that you have not configured the database correctly with Laravel, or

Laravel Time Difference Between Two Carbon Dates in Hours, Minutes, Seconds

Sometimes there is a need to calculate the difference between two dates or timestamps to get the time difference between in hours, minutes seconds, etc, For this, Carbon library also has functions like diffInHours, diffInMinutes