'Laravel - Checking if the user is on a single page

I want to check if the user is editing a specific page. When doing this, another user cannot edit this same page. I would like to constantly check that they will not close the browser tab. I have an idea to make an ajax request every 10 seconds, but it seems not to be optimal. There is a better way?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source