Statistics uses a function insert data to database every time that one user makes a request to the site, then, the best way to do this is using a middleware.
The laralum routes are under
laralum.base middleware and every route you want to be registered will need to go
inside this middleware.
It will insert a into database row with the user id, user ip, user browser, user browser version, user OS, user OS version, locale, browser_locale, and link requested by user.