Just store it in session.
Dec 10, 2015
3
Level 4
Store into session on first time request (auth or not)
I am using the GeoIP to get the user's IP and translate it into a zipcode. I don't want to do that for every request that the user is making but rather do a one time IP to zipcode, store it into session and then when I need to use it just check if the zipcode exists inside the session.
I tried to place the code inside AppServiceProvider@boot but it does not remember it. I tried inside routes but not working as well.
Where do I need to put the code to store the zipcode into the session and have it remembered even if the user is not logged in?
Please or to participate in this conversation.