Please tell me, i need to display a countdown timer on the Laravel blade page. The timer should not be reset when the page is refreshed. The timer should be updated every 24 hours by itself.
That is, I have an event that goes on exactly 24 hours, when the day ends, I have another event and I need the timer to reset to zero and show 24 hours again. How can this be implemented?
Here is how it can be implemented using Carbon:
1) In your controller, grab the current event and calculate the time left between the current timestamp and the event finishing time.
2) Save the result in a variable and pass the variable to the view.
3) In the view, format the time as required to make it look the way you want.