You can create a middleware and attach it to all the routes. Inside the middleware you can determine which page the user is on based on route and store it in the session.
How to get the first page where users go on my website and save it to session
Hi i want to get what is the first page of user that go on my website and save it to my session i use spatie referer to know what is the original page where they click the link going to my website i want to know what is the first page of my website that they went.. thanks! :)
@calvin03 I don't know why you'd want to save it to your session. Do you mean to the database or something?
It sounds like the use case is, a user visits your website and you want to know the first link they click, right?
It would be easier to just use analytics or like @srinathdudi suggested log all page clicks to a database or log file... because detecting first click is likely going to require you to rig together events on each page and detect the click count based on a cookie or something, then destroy the cookie.
Please or to participate in this conversation.