I am currently learning Laravel with Livewire and working on a time tracking system. I am encountering a challenge where I need to persist the time that a user stops when they reload the page. Currently, I have a clock that can start and stop, but I want to ensure that the time continues from where the user left off after a page reload.
The time is stored in a database, but I’m unsure how to retrieve the correct time and display it on the screen after a page reload. Could anyone provide some guidance or ideas on how to implement this?
When a user initiates a timer, it gets stored in the database. One approach I considered was retrieving the most recent timer for the user that lacks a final time. Another thought was to store the time in local storage, but I believe this may not be the optimal solution.